Commit Graph

30 Commits

Author SHA1 Message Date
David Blaikie fd58072675 DebugInfo: Don't include implicit special members in the 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: 219101
2014-10-06 05:18:55 +00:00
David Blaikie 56cfbe841f DebugInfo: Don't include member function template specializations in the 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
2014-10-06 05:06:54 +00:00
Duncan P. N. Exon Smith 3c51fa6aae Revert "Revert "DI: LLVM schema change: fold constants into string""
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
2014-10-03 20:01:52 +00:00
Duncan P. N. Exon Smith 834c265e85 Revert "DI: LLVM schema change: fold constants into string"
This reverts commit r218913 while I investigate some bots.

llvm-svn: 218917
2014-10-02 22:15:09 +00:00
Duncan P. N. Exon Smith 02b418a875 DI: LLVM schema change: fold constants into string
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
2014-10-02 21:56:07 +00:00
Manman Ren 67f005e3b2 [Debug Info] add DISubroutineType and its creation takes DITypeArray.
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
2014-07-28 22:24:34 +00:00
Adrian Prantl f521af81ef Debug info: Update testcases to new DIBuilder behaviour. Variables now
store DIRefs to their types for improved type uniquing.

llvm-svn: 204105
2014-03-18 02:34:54 +00:00
Adrian Prantl a763447124 Implement a new -fstandalone-debug option. rdar://problem/15685848
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
2014-01-07 01:19:08 +00:00
Manman Ren 41f9f4a3c5 Debug Info: update testing cases when the context and type fields of
template_type and template_value are updated to use DIRef.

Paired commit with r192320.

llvm-svn: 192321
2013-10-09 19:47:05 +00:00
Manman Ren 07ab3c381c Debug Info: update testing cases when the derived-from field of
DIDerivedType is updated to use DITypeRef.

Paired commit with r192246.

llvm-svn: 192247
2013-10-08 22:56:54 +00:00
Manman Ren c174ea9ac8 Debug Info: update testing cases when the derived-from field of a
DW_TAG_pointer_type is updated to use DITypeRef.

Paired commit with r192018.

llvm-svn: 192019
2013-10-05 01:43:22 +00:00
Eric Christopher 0562b27dcb Temporarily revert r191801 due to conflicts with the revert of r191792.
llvm-svn: 191968
2013-10-04 17:08:47 +00:00
Manman Ren 8a35855cb1 Debug Info: update testing cases when the derived-from field of a
DW_TAG_pointer_type is updated to use DITypeRef.

Paired commit with r191800.

llvm-svn: 191801
2013-10-01 23:46:19 +00:00
Manman Ren 857935978f Debug Info: Update testing case.
DIBuilder now uses an identifier to reference DIType in containing type field of
a DICompositeType (in r190190).

llvm-svn: 190191
2013-09-06 18:46:30 +00:00
David Blaikie 3b1cc9b858 PR17046, PR17092: Debug Info assert-on-valid due to member loss when context 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
2013-09-06 06:45:04 +00:00
Manman Ren e0064d8c24 Debug Info: generate a unique identifier for C++ struct, class, union, and enum.
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
2013-08-29 23:19:58 +00:00
Manman Ren f801f808ba Debug Info: this reverts commit r189600.
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
2013-08-29 20:48:48 +00:00
Manman Ren 035c4b029f Debug Info: generate a unique identifier for C++ struct, class, union, and enum.
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
2013-08-29 18:51:51 +00:00
David Blaikie f2053af82c DebugInfo: Further fix/improvements to r189494 (and LLVM r189495).
Selfhosting was crashing with the same type of problem but involving
template specializations.

llvm-svn: 189530
2013-08-28 23:06:52 +00:00
Manman Ren 4ae7ea6745 Debug Info: follow-up patch to r189283.
Thanks David for his suggestion. This commit updates testing cases
to have more specific CHECKs.

llvm-svn: 189286
2013-08-26 23:19:37 +00:00
Manman Ren c4ca9b0d3a Debug Info: add an identifier field to DICompositeType.
Paired with llvm r189282.
Update testing cases to handle an extra field for DICompositeType.

llvm-svn: 189283
2013-08-26 22:40:31 +00:00
David Blaikie d278589329 DebugInfo: Avoid duplicating types that may be created during the process of 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
2013-08-18 17:36:19 +00:00
David Blaikie fd07c604a9 Only emit debug info for implicit members that actually get codegen, not 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
2013-08-09 17:20:05 +00:00
David Blaikie 86eac722f9 Simplify/generalize some debug info test cases
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
2013-03-19 23:10:14 +00:00
Eric Christopher 086da34119 Revert r158009 since there are some uses of artificial functions in
debug info.

llvm-svn: 166109
2012-10-17 17:37:17 +00:00
Eric Christopher beafa44be8 Reapply "Only emit debug information for methods that are user defined, there's"
As the failing testcase has been fixed.

This reverts commit 0637f407e6ee7fdccde17fbf9a5fcc4853187b3e.

llvm-svn: 158009
2012-06-05 18:16:22 +00:00
John McCall 65485d7694 Revert "Only emit debug information for methods that are user defined, there's"
This reverts r157970, which was not passing on
  clang-x86_64-darwin10-nobootstrap-RA

llvm-svn: 157983
2012-06-05 06:10:39 +00:00
Eric Christopher f5dad49a65 Only emit debug information for methods that are user defined, there's
not much reason to emit for constructors and destructors that aren't
user defined.

rdar://11593099

llvm-svn: 157970
2012-06-05 00:15:06 +00:00
Eric Christopher d36ad66785 Add support to mangle templated member function names with template
args.

Fixes rdar://11042577

llvm-svn: 152691
2012-03-14 00:25:46 +00:00
Eric Christopher 947bb5a1f1 When adding member functions to a class add any specializations of
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
2012-03-13 23:40:48 +00:00