summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info-template-member.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use primary template parameter names for variable template debug infoReid Kleckner2019-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fixes PR41677 Consider: template <typename LHS, typename RHS> constexpr bool is_same_v = false; template <typename T> constexpr bool is_same_v<T, T> = true; template constexpr bool is_same_v<int, int>; Before this change, when emitting debug info for the `is_same_v<int, int>` global variable, clang would crash because it would try to use the template parameter list from the partial specialization to give parameter names to template arguments. This doesn't work in general, since a partial specialization can have fewer arguments than the primary template. Therefore, always use the primary template. Hypothetically we could try to use the parameter names from the partial specialization when possible, but it's not clear this really helps debugging in practice. Reviewers: JDevlieghere, aprantl, ormris, dblaikie Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61408 llvm-svn: 359809
* Add template type and value parameter metadata nodes to template variable ↵Matthew Voss2018-10-031-0/+25
| | | | | | | | | | | | | | | | | | specializations Summary: Add an optional attribute referring to a tuple of type and value template parameter nodes to the DIGlobalVariable node. This allows us to record the parameters of template variable specializations. Reviewers: dblaikie, aprantl, probinson, JDevlieghere, clayborg, jingham Reviewed By: JDevlieghere Subscribers: cfe-commits Tags: #debug-info Differential Revision: https://reviews.llvm.org/D52058 llvm-svn: 343707
* Adapt testcases to LLVM change r312144 in DIGlobalVariableExpressionAdrian Prantl2017-08-301-1/+1
| | | | llvm-svn: 312148
* Update for LLVM global variable debug info API change.Adrian Prantl2016-12-201-2/+3
| | | | | | This reapplies r289921. llvm-svn: 290155
* Revert "Update for LLVM global variable debug info API change."Adrian Prantl2016-12-161-3/+2
| | | | | | This reverts commit r289921. llvm-svn: 289984
* Update for LLVM global variable debug info API change.Adrian Prantl2016-12-161-2/+3
| | | | llvm-svn: 289921
* Revert "Update for LLVM global variable debug info API change."Adrian Prantl2016-12-161-3/+2
| | | | | | This reverts commit 289901 while investigating bot breakage. llvm-svn: 289908
* Update for LLVM global variable debug info API change.Adrian Prantl2016-12-161-2/+3
| | | | llvm-svn: 289901
* Update Clang for D20147 ("DebugInfo: New metadata representation for global ↵Peter Collingbourne2016-09-131-3/+4
| | | | | | | | variables.") Differential Revision: http://reviews.llvm.org/D20415 llvm-svn: 281285
* DebugInfo: Adapt to loss of DITypeRef in LLVM r267296Duncan P. N. Exon Smith2016-04-231-21/+23
| | | | | | | | | | | | | 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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update to match LLVM changes for PR27284.Adrian Prantl2016-04-151-9/+10
| | | | | | | | | (Reverse the ownership between DICompileUnit and DISubprogram.) http://reviews.llvm.org/D19034 <rdar://problem/25256815> llvm-svn: 266445
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-081-2/+1
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* DebugInfo: Metadata constructs now start with DI*Duncan P. N. Exon Smith2015-04-291-14/+14
| | | | | | | | | | 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-14/+31
| | | | | | | Update testcases for LLVM change in r231082 to use the new debug info hierarchy. llvm-svn: 231083
* Emit DeferredDeclsToEmit in a DFS order.Rafael Espindola2015-01-221-1/+1
| | | | | | | | | | | | | | Currently we emit DeferredDeclsToEmit in reverse order. This patch changes that. The advantages of the change are that * The output order is a bit closer to the source order. The change to test/CodeGenCXX/pod-member-memcpys.cpp is a good example. * If we decide to deffer more, it will not cause as large changes in the estcases as it would without this patch. llvm-svn: 226751
* IR: Make metadata typeless in assembly, clang sideDuncan P. N. Exon Smith2014-12-151-18/+18
| | | | | | Match LLVM changes from r224257. llvm-svn: 224259
* DebugInfo: Don't include implicit special members in the list of class membersDavid Blaikie2014-10-061-6/+7
| | | | | | | | By leaving these members out of the member list, we avoid them being emitted into type unit definitions - while still allowing the definition/declaration to be injected into the compile unit as expected. llvm-svn: 219101
* DebugInfo: Don't include member function template specializations in the ↵David Blaikie2014-10-061-2/+7
| | | | | | | | | | list of class members By leaving these members out of the member list, we avoid them being emitted into type unit definitions - while still allowing the definition/declaration to be injected into the compile unit as expected. llvm-svn: 219100
* Revert "Revert "DI: LLVM schema change: fold constants into string""Duncan P. N. Exon Smith2014-10-031-8/+8
| | | | | | | | | | | | | | 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-8/+8
| | | | | | 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-8/+8
| | | | | | | | | 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
* [Debug Info] add DISubroutineType and its creation takes DITypeArray.Manman Ren2014-07-281-2/+2
| | | | | | | This is the last patch to unique the type array of a subroutine type. This is the paired commit with llvm r214132. llvm-svn: 214133
* Debug info: Update testcases to new DIBuilder behaviour. Variables nowAdrian Prantl2014-03-181-2/+2
| | | | | | store DIRefs to their types for improved type uniquing. llvm-svn: 204105
* Implement a new -fstandalone-debug option. rdar://problem/15685848Adrian Prantl2014-01-071-1/+1
| | | | | | | | | | | | | | 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: update testing cases when the context and type fields ofManman Ren2013-10-091-4/+5
| | | | | | | | template_type and template_value are updated to use DIRef. Paired commit with r192320. llvm-svn: 192321
* 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 cases when the derived-from field of aManman Ren2013-10-051-3/+3
| | | | | | | | DW_TAG_pointer_type is updated to use DITypeRef. Paired commit with r192018. llvm-svn: 192019
* Temporarily revert r191801 due to conflicts with the revert of r191792.Eric Christopher2013-10-041-3/+3
| | | | llvm-svn: 191968
* Debug Info: update testing cases when the derived-from field of aManman Ren2013-10-011-3/+3
| | | | | | | | DW_TAG_pointer_type is updated to use DITypeRef. Paired commit with r191800. llvm-svn: 191801
* Debug Info: Update testing case.Manman Ren2013-09-061-2/+2
| | | | | | | 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-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+10
| | | | | | | | | | | | | | | | 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-10/+8
| | | | | | | | 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-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* DebugInfo: Further fix/improvements to r189494 (and LLVM r189495).David Blaikie2013-08-281-3/+8
| | | | | | | Selfhosting was crashing with the same type of problem but involving template specializations. llvm-svn: 189530
* Debug Info: follow-up patch to r189283.Manman Ren2013-08-261-1/+1
| | | | | | | Thanks David for his suggestion. This commit updates testing cases to have more specific CHECKs. llvm-svn: 189286
* Debug Info: add an identifier field to DICompositeType.Manman Ren2013-08-261-3/+3
| | | | | | | Paired with llvm r189282. Update testing cases to handle an extra field for DICompositeType. llvm-svn: 189283
* DebugInfo: Avoid duplicating types that may be created during the process of ↵David Blaikie2013-08-181-0/+28
| | | | | | | | | | | | 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
* Only emit debug info for implicit members that actually get codegen, not ↵David Blaikie2013-08-091-16/+14
| | | | | | | | | | | | 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
* Simplify/generalize some debug info test casesDavid Blaikie2013-03-191-3/+3
| | | | | | | | | Mostly, try to depend on the annotation comments more so these tests are more legible, brief, and agnostic to schema changes in the future (sure, they're not agnostic to changes to the comment annotations but since they're easier to read they should be easier to update if that happens). llvm-svn: 177457
* Revert r158009 since there are some uses of artificial functions inEric Christopher2012-10-171-1/+1
| | | | | | debug info. llvm-svn: 166109
* Reapply "Only emit debug information for methods that are user defined, there's"Eric Christopher2012-06-051-1/+1
| | | | | | | | As the failing testcase has been fixed. This reverts commit 0637f407e6ee7fdccde17fbf9a5fcc4853187b3e. llvm-svn: 158009
* Revert "Only emit debug information for methods that are user defined, there's"John McCall2012-06-051-1/+1
| | | | | | | This reverts r157970, which was not passing on clang-x86_64-darwin10-nobootstrap-RA llvm-svn: 157983
* Only emit debug information for methods that are user defined, there'sEric Christopher2012-06-051-1/+1
| | | | | | | | | not much reason to emit for constructors and destructors that aren't user defined. rdar://11593099 llvm-svn: 157970
* Add support to mangle templated member function names with templateEric Christopher2012-03-141-1/+1
| | | | | | | | args. Fixes rdar://11042577 llvm-svn: 152691
* When adding member functions to a class add any specializations ofEric Christopher2012-03-131-0/+21
function templates as well. A future commit will mangle the added name with the template args like classes are mangled. Fixes rdar://10986010 llvm-svn: 152683
OpenPOWER on IntegriCloud