summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* revert 199757 for buildbot breakage.Adrian Prantl2014-01-211-4/+2
| | | | llvm-svn: 199758
* Debug info: use the file a typedef is defined in as its decl_file insteadAdrian Prantl2014-01-211-2/+4
| | | | | | | | | of the current compilation unit. As a side effect this enables many more LTO uniquing opportunities. rdar://problem/15851206 llvm-svn: 199757
* Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker2014-01-201-2/+2
| | | | | | | | | | | | | | | | | Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. llvm-svn: 199686
* Debug info: Refactor NoLocation and ArtificialLocation to use a common baseAdrian Prantl2014-01-171-13/+16
| | | | | | | | | 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 llvm-svn: 199444
* Revert "Debug info: Ensure that the last stop point in a function is still ↵Adrian Prantl2014-01-071-3/+2
| | | | | | | | within" This reverts commit r198461. llvm-svn: 198714
* Revert "Debug info: Implement a cleaner version of r198461. For symmetry with"Adrian Prantl2014-01-071-2/+3
| | | | | | This reverts commit 198699 so we can get a cleaner patch. llvm-svn: 198713
* Debug info: Implement a cleaner version of r198461. For symmetry withAdrian Prantl2014-01-071-3/+2
| | | | | | | | | 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 llvm-svn: 198699
* update comment.Adrian Prantl2014-01-071-1/+1
| | | | llvm-svn: 198670
* Implement a new -fstandalone-debug option. rdar://problem/15685848Adrian Prantl2014-01-071-6/+6
| | | | | | | | | | | | | | It controls everything that -flimit-debug-info used to, plus the vtable type optimization. The old -fno-limit-debug-info option is now an alias to -fstandalone-debug and vice versa. Standalone is the default on Darwin until dtrace is updated to work with non-standalone debug info (rdar://problem/15758808). Note: I kept the LimitedDebugInfo name in CodeGenOptions::DebugInfoKind because NoStandaloneDebugInfo sounded even more confusing. llvm-svn: 198655
* Debug info: Ensure that the last stop point in a function is still withinAdrian Prantl2014-01-031-2/+3
| | | | | | | | | the lexical block formed by the compound statement that is the function body. rdar://problem/15010825 llvm-svn: 198461
* remove dead code.Adrian Prantl2013-12-231-1/+1
| | | | llvm-svn: 197916
* DebugInfo: Do not include implicit members (implicit special members, ↵David Blaikie2013-12-201-2/+0
| | | | | | | | | | | | | | template instantiations, etc) in the list of members of a structure. These members will still be lazily added to the relevant DWARF DIEs in LLVM but when enumerating the members they will not appear. This allows DWARF type units to be more consistent - the type unit will never contain these special members (so all instances of the type should have the same DIEs without some having some special members and others having others) and the special members will be added to the skeletal declaration that appears in the relevant compile_unit. llvm-svn: 197844
* Debug info: (Bugfix) emit CRV qualifiers for pointers to member functions.Adrian Prantl2013-12-191-4/+6
| | | | | | rdar://problem/15678916. llvm-svn: 197641
* Debug info: Implement (rvalue) reference qualifiers for C++11 non-staticAdrian Prantl2013-12-181-2/+12
| | | | | | | | member functions. Paired commit with LLVM. rdar://problem/15356637 llvm-svn: 197612
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-051-1/+1
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-051-2/+3
| | | | | | | | | | | | | | | | Summary: In general, this type node can be used to represent any type adjustment that occurs implicitly without losing type sugar. The immediate use of this is to adjust the calling conventions of member function pointer types without breaking template instantiation. Fixes PR17996. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2332 llvm-svn: 196451
* DebugInfo: Update caller based on DIType's MDNode* ctor becoming explicit in ↵David Blaikie2013-11-181-1/+2
| | | | | | r195055. llvm-svn: 195056
* Fix vbtable indices when a class shares the vbptr with a non-virtual baseTimur Iskhodzhanov2013-11-051-2/+2
| | | | llvm-svn: 194082
* Fix string assignment, David Blaikie suggestion.Yaron Keren2013-10-211-2/+6
| | | | llvm-svn: 193116
* Add the context that a function was created in as the context for theEric Christopher2013-10-171-8/+10
| | | | | | function, not the context of the context. llvm-svn: 192862
* Reflow slightly.Eric Christopher2013-10-151-2/+2
| | | | llvm-svn: 192736
* Remove extra braces.Eric Christopher2013-10-111-2/+1
| | | | llvm-svn: 192473
* Abstract out the emission of vtables, add basic support for vtable emission ↵Timur Iskhodzhanov2013-09-271-1/+5
| | | | | | | | when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D1532 llvm-svn: 191523
* Debug info: Fix a crash when trying to construct a type with redundantAdrian Prantl2013-09-261-1/+5
| | | | | | | ownership qualifiers. Fixes rdar://problem/14990656. llvm-svn: 191463
* get rid of extra parentheses.Adrian Prantl2013-09-181-2/+1
| | | | llvm-svn: 190962
* Debug info: Explicitly set the DIVariable::isIndirect() flag for VLAs.Adrian Prantl2013-09-181-0/+2
| | | | | | | This allows us to get rid of an ugly hack in the backend. Paired commit with LLVM. llvm-svn: 190960
* DebugInfo: omit debug info for friendsDavid Blaikie2013-09-131-18/+0
| | | | | | | | | 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. llvm-svn: 190716
* CGDebugInfo: Hoist string allocation in a helper function. No functionality ↵Benjamin Kramer2013-09-091-32/+9
| | | | | | change. llvm-svn: 190314
* Fix constructor-related typos.Benjamin Kramer2013-09-091-1/+1
| | | | | | Noticed by Roman Divacky. llvm-svn: 190311
* Debug Info: pass in DIScope instead of DIDescriptor in createFieldType.Manman Ren2013-09-081-1/+1
| | | | | | Improve readability. No functionality change. llvm-svn: 190268
* PR17046, PR17092: Debug Info assert-on-valid due to member loss when context ↵David Blaikie2013-09-061-41/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | creation recreates the item the context is created for By removing the possibility of strange partial definitions with no members that older GCC's produced for the otherwise unreferenced outer types of referenced inner types, we can simplify debug info generation and correct this bug. Newer (4.8.1 and ToT) GCC's don't produce this quirky debug info, and instead produce the full definition for the outer type (except in the case where that type is dynamic and its vtable is not emitted in this TU). During the creation of the context for a type, we may revisit that type (due to the need to visit template parameters, among other things) and used to end up visiting it first there. Then when we would reach the original code attempting to define that type, we would lose debug info by overwriting its members. By avoiding the possibility of latent "defined with no members" types, we can be sure than whenever we already have a type in a cache (either a definition or declaration), we can just return that. In the case of a full definition, our work is done. In the case of a partial definition, we must already be in the process of completing it. And in the case of a declaration, the completed/vtable/etc callbacks can handle converting it to a definition. llvm-svn: 190122
* Reapply r189013 (reverted in r189906) now that the underlying issue is fixed ↵David Blaikie2013-09-041-37/+27
| | | | | | | | | | | | | | 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. llvm-svn: 190001
* Revert "DebugInfo: Remove explicit declaration-emissiong handling now that ↵David Blaikie2013-09-041-27/+37
| | | | | | | | | | | 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. llvm-svn: 189906
* Revert r189649 because it was breaking sanitizer bots.Yunzhong Gao2013-08-301-30/+30
| | | | llvm-svn: 189660
* Fixing a bug where debug info for a local variable gets emitted at file scope.Yunzhong Gao2013-08-301-30/+30
| | | | | | | The patch was discussed in Phabricator. See: http://llvm-reviews.chandlerc.com/D1281 llvm-svn: 189649
* Debug Info: generate a unique identifier for C++ struct, class, union, and enum.Manman Ren2013-08-291-6/+37
| | | | | | | | | | | | | | | | We use CXX mangler to generate unique identifier for external C++ struct, union, class and enum. Types with unique identifier are added to retained types by DIBuilder. Testing cases are updated to reflect the unique identifier generated for types. The order of MDNodes is changed because of retained types and testing cases are updated accordingly. Testing case debug-info-uuid.cpp now emits error with Itanium mangler, since uuid is not yet handled in Itanium mangler. And it will check for the error message. llvm-svn: 189622
* Debug Info: this reverts commit r189600.Manman Ren2013-08-291-60/+7
| | | | | | | | We had further discussions on how to retain types, whether to do it in front end or in DIBuilder. And we agree to do it in DIBuilder so front ends generating unique identifier do not need to worry about retaining them. llvm-svn: 189609
* Debug Info: generate a unique identifier for C++ struct, class, union, and enum.Manman Ren2013-08-291-7/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | We use CXX mangler to generate unique identifier for external C++ struct, union, class and enum. Types with unique identifier are added to RetainedTypes to make sure they are treated as used even when all uses are replaced with the identifiers. A single type can be added to RetainedTypes multiple times. For example, both createForwardDecl and createLimitedType can add the same type to RetainedTypes. A set is used to avoid duplication when updating AllRetainTypes in DIBuilder. Testing cases are updated to reflect the unique identifier generated for types. The order of MDNodes is changed because of retained types and testing cases are updated accordingly. Testing case debug-info-uuid.cpp now emits error with Itanium mangler, since uuid is not yet handled in Itanium mangler. We choose to update RetainedTypes in clang, then at finalize(), we update AllRetainTypes in DIBuilder. The other choice is to update AllRetainTypes in DIBuilder when creating a DICompositeType with unique identifier. This option requires using ValueHandle for AllRetainTypes in DIBuilder since the created DICompositeType can be modified later on by setContainingType etc. llvm-svn: 189600
* 80-col.Eric Christopher2013-08-281-4/+9
| | | | llvm-svn: 189531
* DebugInfo: Further fix/improvements to r189494 (and LLVM r189495).David Blaikie2013-08-281-0/+10
| | | | | | | Selfhosting was crashing with the same type of problem but involving template specializations. llvm-svn: 189530
* Format. Thanks David for pointing it out.Manman Ren2013-08-281-1/+1
| | | | llvm-svn: 189521
* Debug Info: update interface for CreateEnumType and getOrCreateRecordFwdDecl.Manman Ren2013-08-281-5/+7
| | | | | | | | | | 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. llvm-svn: 189519
* More comments for r189494.David Blaikie2013-08-281-1/+4
| | | | llvm-svn: 189516
* Comments for r189494David Blaikie2013-08-281-0/+5
| | | | llvm-svn: 189504
* PR16995: Failing to associate static members with their enclosing classDavid Blaikie2013-08-281-8/+5
| | | | | | | | | | | | | In the transition from declaration (with some members) to definition, we were overwriting the list of members with the empty list when attaching template parameters. The fix is in llvm::DICompositeType::addMember (along with asserts that cause this bug to be covered by existing Clang test cases), including adding some asserts to catch this sort of issue which found issues fixed in this commit. llvm-svn: 189494
* Revert "PR14569: Omit debug info for thunks"David Blaikie2013-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit r189320. Alexey Samsonov and Dmitry Vyukov presented some arguments for keeping these around - though it still seems like those tasks could be solved by a tool just using the symbol table. In a very small number of cases, thunks may be inlined & debug info might be able to save profilers & similar tools from misclassifying those cases as part of the caller. The extra changes here plumb through the VarDecl for various cases to CodeGenFunction - this provides better fidelity through a few APIs but generally just causes the CGF::StartFunction to fallback to using the name of the IR function as the name in the debug info. The changes to debug-info-global-ctor-dtor.cpp seem like goodness. The two names that go missing (in favor of only emitting those names as linkage names) are names that can be demangled - emitting them only as the linkage name should encourage tools to do just that. Again, thanks to Dinesh Dwivedi for investigation/work on this issue. llvm-svn: 189421
* DebugInfo: Emit info for casted decls in template argsDavid Majnemer2013-08-251-1/+2
| | | | | | | | | | | | | | | | | | Summary: Previously the backend wouldn't get to see the underlying GlobalValue that corresponds to the template argument because it would be hidden by a cast at the IR level. Instead strip the pointer casts off of the value until we see the underlying GlobalValue. Reviewers: dblaikie, echristo, majnemer Reviewed By: majnemer CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1508 llvm-svn: 189200
* DebugInfo: Emit info for constant expressions in template argumentsDavid Majnemer2013-08-241-1/+11
| | | | | | | | | | | | | | | | | | | Summary: This allows us to handle the general case where a non-type template argument evaluates to a constant expression which isn't integral or a declaration. This fixes PR16939. Reviewers: dblaikie, rsmith Reviewed By: dblaikie CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1453 llvm-svn: 189165
* DebugInfo: Remove explicit declaration-emissiong handling now that we have a ↵David Blaikie2013-08-221-37/+27
| | | | | | | | more principled approach (the 'requires complete type' callback) No functionality change intended. llvm-svn: 189013
* DebugInfo: Require only the declaration of types only used as parameter and ↵David Blaikie2013-08-211-2/+2
| | | | | | return types llvm-svn: 188962
OpenPOWER on IntegriCloud