summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info-class.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Skip type units/type uniquing when we know we're only emitting the type once ↵David Blaikie2019-04-251-7/+23
| | | | | | | | | | | | | | | (vtable-based emission when triggered by a strong vtable, with -fno-standalone-debug) (this would regress size without a corresponding LLVM change that avoids putting other user defined types inside type units when they aren't in their own type units - instead emitting declarations inside the type unit and a definition in the primary CU) Reviewers: aprantl Differential Revision: https://reviews.llvm.org/D61079 llvm-svn: 359235
* DebugInfo: Fix bitrotted test caseDavid Blaikie2019-04-251-8/+7
| | | | | | | This test was updated with some CHECK suffix variants, but dropped checking for the unsuffixed 'CHECK' llvm-svn: 359217
* [Lit Test] Make tests C++11 compatible - nothrow destructorsCharles Li2017-01-091-5/+10
| | | | | | | | | In C++11, a destructor's implicit exception-spec is nothrow. The IR for the destructor's invocation changed from invoke to call. Differential Revision: https://reviews.llvm.org/D28425 llvm-svn: 291458
* DebugInfo: Don't include size/alignment on class declarationsDavid Blaikie2016-12-271-0/+1
| | | | | | | | | | This seems like it must've been a leftover by accident - no tests were backing it up & it doesn't make much sense to include size/alignment on class declarations (it'd only be on those declarations for which the definition was available - otherwise the size/alignment would not be known). llvm-svn: 290631
* DebugInfo: Adapt to loss of DITypeRef in LLVM r267296Duncan P. N. Exon Smith2016-04-231-21/+22
| | | | | | | | | | | | | LLVM stopped using MDString-based type references, and DIBuilder no longer fills 'retainedTypes:' with every DICompositeType that has an 'identifier:' field. There are just minor changes to keep the same behaviour in CFE. Leaving 'retainedTypes:' unfilled has a dramatic impact on the output order of the IR though. There are a huge number of testcase changes, which were unfortunately not really scriptable. llvm-svn: 267297
* DebugInfo: Make DICompositeTypes distinct most of the timeDuncan P. N. Exon Smith2016-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since elements of most kinds of DICompositeType have back references, most are involved in uniquing cycles. Except via the ODR 'identifier:' field, which doesn't care about the storage type (see r266549), they have no hope of being uniqued. Distinct nodes are far more efficient, so use them for most kinds of DICompositeType definitions (i.e., when DIType::isForwardDecl is false). The exceptions: - DW_TAG_array_type, since their elements never have back-references and they never have ODR 'identifier:' fields; - DW_TAG_enumeration_type when there is no ODR 'identifier:' field, since their elements usually don't have back-references. This breaks the last major uniquing cycle I'm aware of in the debug info graph. The impact won't be enormous for C++ because references to ODR-uniqued nodes still use string-based DITypeRefs; but this should prevent a regression in C++ when we drop the string-based references. This wouldn't have been reasonable until r266549, when composite types stopped relying on being uniqued by structural equivalence to prevent blow-ups at LTO time. llvm-svn: 266556
* Remove compile time PreserveName in favor of a runtime cc1 ↵Mehdi Amini2016-03-131-3/+3
| | | | | | | | | | | | | | | | | | | | -discard-value-names option Summary: This flag is enabled by default in the driver when NDEBUG is set. It is forwarded on the LLVMContext to discard all value names (but GlobalValue) for performance purpose. This an improved version of D18024 Reviewers: echristo, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18127 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263394
* DebugInfo: Metadata constructs now start with DI*Duncan P. N. Exon Smith2015-04-291-23/+23
| | | | | | | | | | LLVM r236120 renamed debug info IR constructs to use a `DI` prefix, now that the `DIDescriptor` hierarchy has been gone for about a week. This commit was generated using the rename-md-di-nodes.sh upgrade script attached to PR23080, followed by running clang-format-diff.py on the `lib/` portion of the patch. llvm-svn: 236121
* DebugInfo: Move new hierarchy into place (clang)Duncan P. N. Exon Smith2015-03-031-24/+54
| | | | | | | Update testcases for LLVM change in r231082 to use the new debug info hierarchy. llvm-svn: 231083
* IR: Move MDLocation into place (clang testcases)Duncan P. N. Exon Smith2015-01-141-2/+2
| | | | | | Update testcases to match LLVM change in r226048. llvm-svn: 226049
* IR: Make metadata typeless in assembly, clang sideDuncan P. N. Exon Smith2014-12-151-13/+13
| | | | | | Match LLVM changes from r224257. llvm-svn: 224259
* DebugInfo: Don't emit a 'global variable' when a static member declaration ↵David Blaikie2014-11-191-4/+0
| | | | | | | | | is referenced without a definition, just ensure the enclosing class (with the static member declaration) is emitted. Addresses PR21511 by emitting appropriate metadata rather than faux-global definitions for a variable that doesn't have a definition. llvm-svn: 222377
* Debug Info: context field of a global variable is DIScopeRef.Manman Ren2014-11-181-1/+1
| | | | | | Paired commit with r222195. llvm-svn: 222196
* Revert "Revert "DI: LLVM schema change: fold constants into string""Duncan P. N. Exon Smith2014-10-031-9/+9
| | | | | | | | | | | | | | This reverts commit r218917, effectively reapplying r218913. Original commit message follows. -- Update debug info testcases for an LLVM metadata schema change to fold metadata constant operands into a single `MDString`. Part of PR17891. llvm-svn: 219011
* Revert "DI: LLVM schema change: fold constants into string"Duncan P. N. Exon Smith2014-10-021-9/+9
| | | | | | This reverts commit r218913 while I investigate some bots. llvm-svn: 218917
* DI: LLVM schema change: fold constants into stringDuncan P. N. Exon Smith2014-10-021-9/+9
| | | | | | | | | Update debug info testcases for an LLVM metadata schema change to fold metadata constant operands into a single `MDString`. Part of PR17891. llvm-svn: 218913
* Fixing tests to account for LLVM r208159.David Blaikie2014-05-071-1/+1
| | | | llvm-svn: 208160
* DebugInfo: Do not include implicit members (implicit special members, ↵David Blaikie2013-12-201-7/+8
| | | | | | | | | | | | | | 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: update testing cases when the derived-from field ofManman Ren2013-10-081-1/+1
| | | | | | | | DIDerivedType is updated to use DITypeRef. Paired commit with r192246. llvm-svn: 192247
* Debug Info: Update testing case.Manman Ren2013-09-061-1/+1
| | | | | | | DIBuilder now uses an identifier to reference DIType in containing type field of a DICompositeType (in r190190). llvm-svn: 190191
* PR17046, PR17092: Debug Info assert-on-valid due to member loss when context ↵David Blaikie2013-09-061-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Debug Info: generate a unique identifier for C++ struct, class, union, and enum.Manman Ren2013-08-291-14/+13
| | | | | | | | | | | | | | | | 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-13/+14
| | | | | | | | 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-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Debug Info: add an identifier field to DICompositeType.Manman Ren2013-08-261-6/+6
| | | | | | | Paired with llvm r189282. Update testing cases to handle an extra field for DICompositeType. llvm-svn: 189283
* DebugInfo: emit the definition of types when construction vtables are ↵David Blaikie2013-08-221-2/+9
| | | | | | | | | | required as these types may never end up emitting the full class data This might be able to be optimized further by only doing this in the absence of a key function, but it doesn't look like GCC is doing that so I'm not rushing to do it just yet. llvm-svn: 189022
* Revert "Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic ↵David Blaikie2013-08-201-9/+67
| | | | | | | | | | | | | | 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-67/+9
| | | | | | | | | | | | | 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
* Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that ↵David Blaikie2013-08-181-9/+67
| | | | | | | | | | | | 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: Don't emit vbase 'containing types' for context chain limited typesDavid Blaikie2013-08-181-2/+17
| | | | | | | | | 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
* Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not ↵David Blaikie2013-08-171-46/+4
| | | | | | | | | | have the vtable for that class" This reverts commit r188576. Reverting while I investigate a selfhosting buildbot failure on Darwin. llvm-svn: 188600
* DebugInfo: Omit debug info for dynamic classes in TUs that do not have the ↵David Blaikie2013-08-161-4/+46
| | | | | | | | | vtable for that class This reduces Clang's .dwo (fission debug info) size by 23% over Clang+LLVM. llvm-svn: 188576
* clang/test/CodeGenCXX/debug-info-class.cpp: Tweak to unbreak test for a few ↵NAKAMURA Takumi2013-02-031-2/+6
| | | | | | | | | | targets. - Relax a expression for arm-gnueabi. - Exclude msvc to limit target triplets to add limited a few targets. Feel free to remove actions if guys thought they redundant. llvm-svn: 174278
* clang/test/CodeGenCXX/debug-info-class.cpp: Fixup for -Asserts.NAKAMURA Takumi2013-02-011-2/+3
| | | | llvm-svn: 174229
* Fix exception handling line table problems introduced by r173593David Blaikie2013-02-011-9/+23
| | | | | | | | | | | | | r173593 made us a little too eager to associate all code at the end of a function with the user-written 'return' line. This caused problems with breakpoints as they'd be set in exception handling code preceeding the actual non-exception return handling code, leading to the breakpoint never being hit in non-exceptional execution. This change restores the pre-r173593 exception handling line information where the cleanup code is associated with the '}' not the return line. llvm-svn: 174206
* Debug Info: Emit vtables pointer members as artificial.David Blaikie2012-12-131-2/+7
| | | | | | | | | | | | I wasn't sure where to put the test case for this, but this seemed like as good a place as any. I had to reorder the tests here to make them legible while still matching the order of metadata output in the IR file (for some reason making it virtual changed the ordering). Relevant commit to fix up LLVM to actually respect 'artificial' member variables is coming once I write up a test case for it. llvm-svn: 170154
* Emit debug info for C++ struct definitions as DW_TAG_structure_type (instead ↵David Blaikie2012-11-021-1/+1
| | | | | | of class_type). llvm-svn: 167336
* Fix debug tag type of forward declarations of struct/class in C++.David Blaikie2012-11-021-3/+15
| | | | llvm-svn: 167308
* Emit debug info for static const class member.Devang Patel2010-08-121-0/+12
llvm-svn: 110885
OpenPOWER on IntegriCloud