summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.h
Commit message (Collapse)AuthorAge
* Delete apparently unused methodAlexey Samsonov2014-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210047 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Use enum instead of unsignedEd Maste2014-05-07
| | | | | | | | | This makes debuging DebugInfo generation with LLDB a little more pleasant. Differential Revision: http://reviews.llvm.org/D3626 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208203 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply: DebugInfo: Emit the definition of enums when the definition ↵David Blaikie2014-05-06
| | | | | | | | | | | | | | | | | | | preceeds the declaration and initial use. Reverting r208106 to reapply r208065 with a fix for the regression. The issue was that the enum tried to be built even if the declaration hadn't been constructed for debug info - presenting problems for enum templates and typedefs of enums with names for linkage purposes. Original commit message: This regressed a little further 208055 though it was already a little broken. While the requiresCompleteType optimization should be implemented here. Future (possibly near future) work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208114 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "DebugInfo: Emit the definition of enums when the definition preceeds ↵David Blaikie2014-05-06
| | | | | | | | | | | the declaration and initial use." This is breaking the compiler-rt build. Reverting while I investigate/fix. This reverts commit r208065. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208106 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Emit the definition of enums when the definition preceeds the ↵David Blaikie2014-05-06
| | | | | | | | | | | | declaration and initial use. This regressed a little further 208055 though it was already a little broken. While the requiresCompleteType optimization should be implemented here. Future (possibly near future) work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208065 91177308-0d34-0410-b5e6-96231b3b80d8
* PR19598: Ensure temporary metadata nodes used in debug info are destroyed.David Blaikie2014-05-06
| | | | | | | | | | | | | | | | | | | CGDebugInfo and DIBuilder were lax in their handling of temporary MDNodes. All temporary nodes need to be deleted, which means they need to be RAUW'd with a permanent node. This was not happening. To ensure this, leverage DIBuilder's new ability to create both permanent and temporary declarations. Ensure all temporary declarations are RAUW'd, even with itself. (DIDescriptor::RAUW handles the case where it is replaced with itself and creates a new, duplicate permanent node to replace itself with) This means that all temporary declarations must be added to the ReplacementMap even if they're never upgraded to definitions - so move the point of insertion into the map to the point of creation of the declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208055 91177308-0d34-0410-b5e6-96231b3b80d8
* Build debug info for ObjC interface types at the end of the translation unit ↵David Blaikie2014-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to ensure all ivars are included. This takes a different approach than the completedType/requiresCompleteType work which relies on AST callbacks to upgrade the type declaration to a definition. Instead, just defer constructing the definition to the end of the translation unit. This works because the definition is never needed by other debug info (so far as I know), whereas the definition of a struct may be needed by other debug info before the end of the translation unit (such as emitting the definition of a member function which must refer to that member function's declaration). If we had a callback for whenever an IVar was added to an ObjC interface we could use that, and remove the need for the ObjCInterfaceCache, which might be nice. (also would need a callback for when it was more than just a declaration so we could get properties, etc). A side benefit is that we also don't need the CompletedTypeCache anymore. Just rely on the declaration-ness of a type to decide whether its definition is yet to be emitted. There's still the PR19562 memory leak, but this should hopefully make that a bit easier to approach. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208015 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: (Bugfix) Make sure artificial functions like _GLOBAL__I_aAdrian Prantl2014-04-10
| | | | | | | | | | | | | | | | are not associated with any source lines. Previously, if the Location of a Decl was empty, EmitFunctionStart would just keep using CurLoc, which would sometimes be correct (e.g., thunks) but in other cases would just point to a hilariously random location. This patch fixes this by completely eliminating all uses of CurLoc from EmitFunctionStart and rather have clients explicitly pass in a SourceLocation for the function header and the function body. rdar://problem/14985269 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205999 91177308-0d34-0410-b5e6-96231b3b80d8
* Add global static variables for anonymous union fields. This makesEric Christopher2014-04-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sure that a debugger can find them when stepping through code, for example from the included testcase: 12 int test_it() { 13 c = 1; 14 d = 2; -> 15 a = 4; 16 return (c == 1); 17 } 18 (lldb) p a (int) $0 = 2 (lldb) p c (int) $1 = 2 (lldb) p d (int) $2 = 2 and a, c, d are all part of the file static anonymous union: static union { int c; int d; union { int a; }; struct { int b; }; }; Fixes PR19221. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205952 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Support type alias templatesDavid Blaikie2014-04-06
| | | | | | | | We already got the type alias correct (though I've included a test case here) since Clang represents that like any other typedef - but type alias templates weren't being handled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205691 91177308-0d34-0410-b5e6-96231b3b80d8
* Adapt CGDebugInfo to interface changes in DIBuilder/DIImportedEntity.Adrian Prantl2014-04-01
| | | | | | | The Decl field in a DIImportedEntity is now a DIRef. Paired commit with LLVM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205278 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Update include of DebugInfo.h which moved to the IR libraryChandler Carruth2014-03-06
| | | | | | in LLVM r203046. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203047 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Update include for the move of DIBuilder.h to the IR libraryChandler Carruth2014-03-06
| | | | | | in LLVM r203038. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203039 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Update to reflect ValueHandle moving to the IR library in LLVMChandler Carruth2014-03-04
| | | | | | r202821. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202822 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Emit only the declaration of a class template that has an ↵David Blaikie2014-03-03
| | | | | | | | | | | | | | | | | | | | | | | explicit instantiation declaration (& always emit such a type when there's an explicit instantiation definition) We should only have this optimization fire when the explicit instantiation definition would cause at least one member function to be emitted, thus ensuring that even a compiler not performing this optimization would still emit the full type information elsewhere. But we should also pessimize output still by always emitting the definition when the explicit instantiation definition appears so that at some point in the future we can depend on that information even when no code had to be emitted in that TU. (this shouldn't happen very often, since people mostly use explicit spec decl/defs to reduce code size - but perhaps one day they could use it to explicitly reduce debug info size too) This was worth about 2% for Clang and LLVM - so not a huge win, but a win. It looks really great for simple STL programs (include <string> and just declare a string - 14k -> 1.4k of .dwo) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202769 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Refactor NoLocation and ArtificialLocation to use a common baseAdrian Prantl2014-01-17
| | | | | | | | | class and use it pervasively to restore debug locations. Fixes an interaction between cleanup and EH that caused the location to not be restored properly after emitting a landing pad. rdar://problem/15208190 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199444 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Debug info: Ensure that the last stop point in a function is still ↵Adrian Prantl2014-01-07
| | | | | | | | within" This reverts commit r198461. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198714 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Debug info: Implement a cleaner version of r198461. For symmetry with"Adrian Prantl2014-01-07
| | | | | | This reverts commit 198699 so we can get a cleaner patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198713 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Implement a cleaner version of r198461. For symmetry withAdrian Prantl2014-01-07
| | | | | | | | | C and C++ don't emit an extra lexical scope for the compound statement that is the body of an Objective-C method. rdar://problem/15010825 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198699 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Ensure that the last stop point in a function is still withinAdrian Prantl2014-01-03
| | | | | | | | | the lexical block formed by the compound statement that is the function body. rdar://problem/15010825 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198461 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: omit debug info for friendsDavid Blaikie2013-09-13
| | | | | | | | | GCC ToT doesn't do this & it's worth about 3.2% on Clang's DWO file size with Clang. Some or all of this may be due to things like r190715 which could have source fixes/improvements, but it's not clear that's the case and that doesn't help other source bases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190716 91177308-0d34-0410-b5e6-96231b3b80d8
* CGDebugInfo: Hoist string allocation in a helper function. No functionality ↵Benjamin Kramer2013-09-09
| | | | | | change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190314 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix constructor-related typos.Benjamin Kramer2013-09-09
| | | | | | Noticed by Roman Divacky. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190311 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: pass in DIScope instead of DIDescriptor in createFieldType.Manman Ren2013-09-08
| | | | | | | Improve readability. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190268 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r189013 (reverted in r189906) now that the underlying issue is fixed ↵David Blaikie2013-09-04
| | | | | | | | | | | | | | and tested (in r189996) Debug info emission was tripping over an IRGen bug (fixed in r189996) that was resulting in duplicate emission of static data members of class templates in namespaces. We could add more test coverage to debug info for this issue specifically, but I think the underlying IRGen test is more targeted and sufficient for the issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190001 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "DebugInfo: Remove explicit declaration-emissiong handling now that ↵David Blaikie2013-09-04
| | | | | | | | | | | we have a more principled approach (the 'requires complete type' callback)" This reverts commit r189013. This is causing a segfault crash in a test case I have. Reverting while I investigate the issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189906 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r189649 because it was breaking sanitizer bots.Yunzhong Gao2013-08-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189660 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing a bug where debug info for a local variable gets emitted at file scope.Yunzhong Gao2013-08-30
| | | | | | | | | The patch was discussed in Phabricator. See: http://llvm-reviews.chandlerc.com/D1281 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189649 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: update interface for CreateEnumType and getOrCreateRecordFwdDecl.Manman Ren2013-08-28
| | | | | | | | | | | Both functions will take a Type pointer instead of a Decl pointer. This helps with follow-up type uniquing patches, which need the Type pointer to call CXX mangler to generate unique identifiers. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189519 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Remove explicit declaration-emissiong handling now that we have a ↵David Blaikie2013-08-22
| | | | | | | | more principled approach (the 'requires complete type' callback) No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189013 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: comment/inlining based on feedback from Eric & AdrianDavid Blaikie2013-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188834 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Simplify/clarify propagation of typemembers between declaration ↵David Blaikie2013-08-20
| | | | | | | | | and definition Based on code review feedback from Eric Christopher (on r188739) and Adrian Prantl (r188642). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188829 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic ↵David Blaikie2013-08-20
| | | | | | | | | | | | | | classes in TUs that do not have the vtable for that class"""" This reverts commit r188687 (reverts r188642 (reverts 188600 (reverts 188576))). With added test coverage & fix for -gline-tables-only. Thanks Michael Gottesman for reverting this patch when it demonstrated problems & providing a reproduction/details to help me track this down. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188739 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in ↵Michael Gottesman2013-08-19
| | | | | | | | | | | | | TUs that do not have the vtable for that class""" This reverts commit r188642. This change is causing LTO builds to cause our 16 GB machines to swap and OOM all weekend. I am going to work with Dave Blaikie to resolve the issue. Sorry Dave =(. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188687 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that ↵David Blaikie2013-08-18
| | | | | | | | | | | | do not have the vtable for that class"" This reverts commit r188600. r188640/r188639 fixed the root cause of the crash-on-valid that r188600 originally introduced. This now appears to bootstrap debug clang successfully to the best of my testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188642 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Don't emit vbase 'containing types' for context chain limited typesDavid Blaikie2013-08-18
| | | | | | | | | Possible minor reduction in debug info & avoid some cases where creating a context chain could lead to the type the context chain is being created for, being created. (this is still possible with template parameters - tests/fixes/improvements to follow) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188639 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not ↵David Blaikie2013-08-17
| | | | | | | | | | have the vtable for that class" This reverts commit r188576. Reverting while I investigate a selfhosting buildbot failure on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188600 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Omit debug info for dynamic classes in TUs that do not have the ↵David Blaikie2013-08-16
| | | | | | | | | vtable for that class This reduces Clang's .dwo (fission debug info) size by 23% over Clang+LLVM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188576 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Contrain the record type parameter for CollectRecordFieldsDavid Blaikie2013-08-16
| | | | | | | This is the correct type (as is demonstrated by the fact that the caller didn't need to change) & will be useful in a future patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188575 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r188498.Evgeniy Stepanov2013-08-16
| | | | | | | | This change broke release+asserts build with compiler-rt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188539 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: CollectRecordStaticField -> CreateRecordStaticField to return its ↵David Blaikie2013-08-15
| | | | | | result. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188501 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Split out the implementation of getStaticDataMemberDeclaration ↵David Blaikie2013-08-15
| | | | | | for future use git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188498 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type ↵David Blaikie2013-08-15
| | | | | | | | | match the semantics Rather than having a cast immediately inside the function, push that type requirement out to the callers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188492 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Unify & optimize the lazy addition of record typesDavid Blaikie2013-08-15
| | | | | | | | | | | | | | | Rather than going through the whole getOrCreateType machinery to manifest a type, cut straight to the implementation because we know we have to do work. While the previous implementation was sufficient for the two cases (completeness and required completeness) we have already (the general machinery could inspect the type for those attributes & go down the full definition path), a pending change (to emit info for types when we emit their vtables) won't have that luxury & we'll need to force the creation rather than relying on the general purpose routine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188486 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Revert change to the return type of createRecordFwdDeclDavid Blaikie2013-08-15
| | | | | | | It still does only return DICompositeType, but I've no need to make that change right now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188482 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Don't create duplicate forward declaration metadata unnecessarily.David Blaikie2013-08-15
| | | | | | | No functionality change, at best a slight (questionable) optimization, but necessary for correctness of future work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188474 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: simplify some limited/declaration creation APIsDavid Blaikie2013-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188214 91177308-0d34-0410-b5e6-96231b3b80d8
* typo.Adrian Prantl2013-07-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187089 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Fix an oversight of r186553. Ensure that the function prologueAdrian Prantl2013-07-24
| | | | | | of an artificial function gets an artificial location as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187074 91177308-0d34-0410-b5e6-96231b3b80d8
* s/BuiltinLocation/ArtificialLocation/Adrian Prantl2013-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186557 91177308-0d34-0410-b5e6-96231b3b80d8