summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* DebugInfo: comment/inlining based on feedback from Eric & AdrianDavid Blaikie2013-08-201-15/+16
| | | | llvm-svn: 188834
* DebugInfo: Simplify/clarify propagation of typemembers between declaration ↵David Blaikie2013-08-201-30/+18
| | | | | | | | | and definition Based on code review feedback from Eric Christopher (on r188739) and Adrian Prantl (r188642). llvm-svn: 188829
* Revert "Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic ↵David Blaikie2013-08-201-29/+86
| | | | | | | | | | | | | | 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. llvm-svn: 188739
* Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in ↵Michael Gottesman2013-08-191-85/+30
| | | | | | | | | | | | | 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 =(. llvm-svn: 188687
* DebugInfo: Do not include line/file info for artificial parameters & ↵David Blaikie2013-08-191-5/+18
| | | | | | parameters of artificial functions llvm-svn: 188651
* Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that ↵David Blaikie2013-08-181-30/+85
| | | | | | | | | | | | 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. llvm-svn: 188642
* DebugInfo: Avoid duplicating types that may be created during the process of ↵David Blaikie2013-08-181-0/+13
| | | | | | | | | | | | creating their context A partner to r188639, this is a somewhat heavy-handed fix to the general issue, since even after that prior change the issue does still unavoidably arise with template parameters (see test case). There are other ways we could consider addressing this (see FIXME). llvm-svn: 188640
* DebugInfo: Don't emit vbase 'containing types' for context chain limited typesDavid Blaikie2013-08-181-25/+31
| | | | | | | | | 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) llvm-svn: 188639
* DebugInfo: don't require full definitions for friend classesDavid Blaikie2013-08-181-3/+2
| | | | | | | | | | Fixes a crash-on-valid introduced by r188486 (which should've occurred earlier but for a blatant bug where calling createFwdDecl from the requireCompleteType callback was useless under -flimit-debug-info and we were just getting lucky with other later callbacks requiring the type anyway). llvm-svn: 188622
* PR16927: Don't assert (or, previously, skip) static data members of ↵David Blaikie2013-08-171-3/+0
| | | | | | enumeration type llvm-svn: 188612
* Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not ↵David Blaikie2013-08-171-73/+28
| | | | | | | | | | have the vtable for that class" This reverts commit r188576. Reverting while I investigate a selfhosting buildbot failure on Darwin. llvm-svn: 188600
* DebugInfo: Canonicalize namespaces to avoid emitting multiple namespaces ↵David Blaikie2013-08-161-0/+1
| | | | | | | | | | | | with the same name but different lines Updated test case to not rely on line numbers in more cases (it's hard to use the @ check syntax for debug info test cases (due to the interesting ordering of metadata) and this case in particular (given the hash-line directive)) - left a few in there to cover the line number information for these. llvm-svn: 188585
* DebugInfo: Omit debug info for dynamic classes in TUs that do not have the ↵David Blaikie2013-08-161-28/+73
| | | | | | | | | vtable for that class This reduces Clang's .dwo (fission debug info) size by 23% over Clang+LLVM. llvm-svn: 188576
* DebugInfo: Contrain the record type parameter for CollectRecordFieldsDavid Blaikie2013-08-161-4/+4
| | | | | | | 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. llvm-svn: 188575
* Revert r188498.Evgeniy Stepanov2013-08-161-23/+19
| | | | | | This change broke release+asserts build with compiler-rt. llvm-svn: 188539
* DebugInfo: CollectRecordStaticField -> CreateRecordStaticField to return its ↵David Blaikie2013-08-151-8/+7
| | | | | | result. llvm-svn: 188501
* Remove unnecessary explicit cast.David Blaikie2013-08-151-1/+1
| | | | llvm-svn: 188500
* DebugInfo: Split out the implementation of getStaticDataMemberDeclaration ↵David Blaikie2013-08-151-19/+23
| | | | | | for future use llvm-svn: 188498
* Fix assert added in r188494David Blaikie2013-08-151-1/+1
| | | | llvm-svn: 188496
* DebugInfo: Remove unused conditionalDavid Blaikie2013-08-151-3/+2
| | | | llvm-svn: 188494
* DebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type ↵David Blaikie2013-08-151-6/+5
| | | | | | | | | match the semantics Rather than having a cast immediately inside the function, push that type requirement out to the callers. llvm-svn: 188492
* DebugInfo: Add a FIXME, remove a FIXME.David Blaikie2013-08-151-3/+4
| | | | | | | (the removed FIXME no longer applies since we made this debug info optimization not apply to C) llvm-svn: 188491
* DebugInfo: Unify & optimize the lazy addition of record typesDavid Blaikie2013-08-151-14/+26
| | | | | | | | | | | | | | | 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. llvm-svn: 188486
* DebugInfo: Revert change to the return type of createRecordFwdDeclDavid Blaikie2013-08-151-5/+3
| | | | | | | It still does only return DICompositeType, but I've no need to make that change right now. llvm-svn: 188482
* DebugInfo: remove unnecessary type registrationDavid Blaikie2013-08-151-1/+0
| | | | | | This happens in the caller a few frames up anyway. llvm-svn: 188475
* DebugInfo: Don't create duplicate forward declaration metadata unnecessarily.David Blaikie2013-08-151-4/+8
| | | | | | | No functionality change, at best a slight (questionable) optimization, but necessary for correctness of future work. llvm-svn: 188474
* Drive by cleanupDavid Blaikie2013-08-131-7/+2
| | | | llvm-svn: 188251
* DebugInfo: Simplify declaration building code - relying on the limit debug ↵David Blaikie2013-08-121-17/+6
| | | | | | info checking already in CreateType(RecordType) llvm-svn: 188222
* DebugInfo: simplify some limited/declaration creation APIsDavid Blaikie2013-08-121-36/+10
| | | | llvm-svn: 188214
* Only emit debug info for implicit members that actually get codegen, not ↵David Blaikie2013-08-091-7/+10
| | | | | | | | | | | | just ODR use. This includes special members (copy/default ctor, copy assign, default ctor) and template specializations for member function templates. Good for a 5% decrease (1.80 to 1.71 GB) in size on Clang+LLVM's .dwo files (when using fission). llvm-svn: 188085
* DebugInfo: Don't prefer declarations over definitions in -flimit-debug-info in CDavid Blaikie2013-08-011-2/+3
| | | | | | | | | Without an ODR, the -flimit-debug-info debug info size optimization of emitting declarations for fully defined types when only a declaration is needed by the TU, is incorrect. Emit the full definition whenever it's available in non-C++. llvm-svn: 187611
* DebugInfo: Emit template arguments for limited types used for context.David Blaikie2013-08-011-5/+5
| | | | | | | | We emit definitions with no members when a nested type is referenced/required (GCC does the same, to be fair) but failed to attach the template arguments in such a case. llvm-svn: 187608
* Reduce a variable's scope (no functionality change)David Blaikie2013-08-011-2/+1
| | | | llvm-svn: 187594
* Debug Info: Fix an oversight of r186553. Ensure that the function prologueAdrian Prantl2013-07-241-3/+9
| | | | | | of an artificial function gets an artificial location as well. llvm-svn: 187074
* Implement a better fix for r186894 by setting the appropriate type for ↵Adrian Prantl2013-07-231-2/+3
| | | | | | | | __byref_variable_layout. rdar://problem/14386148 llvm-svn: 186898
* Debug Info: Acknowledge the alignment when locating byref block variables.Adrian Prantl2013-07-221-0/+1
| | | | | | Fixes rdar://problem/14386148 llvm-svn: 186894
* Update createCompileUnit call for llvm changes.Eric Christopher2013-07-191-5/+4
| | | | llvm-svn: 186638
OpenPOWER on IntegriCloud