Commit Graph

223 Commits

Author SHA1 Message Date
Chandler Carruth 0654bacac3 [Layering] Update include of DebugInfo.h which moved to the IR library
in LLVM r203046.

llvm-svn: 203047
2014-03-06 00:46:56 +00:00
Chandler Carruth 7c582545a4 [Layering] Update include for the move of DIBuilder.h to the IR library
in LLVM r203038.

llvm-svn: 203039
2014-03-06 00:22:29 +00:00
Chandler Carruth 61743af166 [Modules] Update to reflect ValueHandle moving to the IR library in LLVM
r202821.

llvm-svn: 202822
2014-03-04 11:18:19 +00:00
David Blaikie 0e716b42f4 DebugInfo: Emit only the declaration of a class template that has an explicit instantiation declaration (& always emit such a type when there's an explicit instantiation definition)
We should only have this optimization fire when the explicit
instantiation definition would cause at  least one member function to be
emitted, thus ensuring that even a compiler not performing this
optimization would still emit the full type information elsewhere.

But we should also pessimize output still by always emitting the
definition when the explicit instantiation definition appears so that at
some point in the future we can depend on that information even when no
code had to be emitted in that TU. (this shouldn't happen very often,
since people mostly use explicit spec decl/defs to reduce code size -
but perhaps one day they could use it to explicitly reduce debug info
size too)

This was worth about 2% for Clang and LLVM - so not a huge win, but a
win. It looks really great for simple STL programs (include <string> and
just declare a string - 14k -> 1.4k of .dwo)

llvm-svn: 202769
2014-03-03 23:48:23 +00:00
Adrian Prantl d1b151ed7c Debug info: Refactor NoLocation and ArtificialLocation to use a common base
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
2014-01-17 00:15:10 +00:00
Adrian Prantl e83b130def Revert "Debug info: Ensure that the last stop point in a function is still within"
This reverts commit r198461.

llvm-svn: 198714
2014-01-07 22:05:52 +00:00
Adrian Prantl c6758879b3 Revert "Debug info: Implement a cleaner version of r198461. For symmetry with"
This reverts commit 198699 so we can get a cleaner patch.

llvm-svn: 198713
2014-01-07 22:05:45 +00:00
Adrian Prantl f5ff0dc29b Debug info: Implement a cleaner version of r198461. For symmetry with
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
2014-01-07 19:24:24 +00:00
Adrian Prantl 96e70d9148 Debug info: Ensure that the last stop point in a function is still within
the lexical block formed by the compound statement that is the function
body.

rdar://problem/15010825

llvm-svn: 198461
2014-01-03 23:34:30 +00:00
David Blaikie dedd27fc62 DebugInfo: omit debug info for friends
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
2013-09-13 18:45:00 +00:00
Benjamin Kramer 1b18a5ec28 CGDebugInfo: Hoist string allocation in a helper function. No functionality change.
llvm-svn: 190314
2013-09-09 16:39:06 +00:00
Benjamin Kramer 60509af49a Fix constructor-related typos.
Noticed by Roman Divacky.

llvm-svn: 190311
2013-09-09 14:48:42 +00:00
Manman Ren 2c826dcc20 Debug Info: pass in DIScope instead of DIDescriptor in createFieldType.
Improve readability. No functionality change.

llvm-svn: 190268
2013-09-08 03:45:05 +00:00
David Blaikie 99dab3b43c Reapply r189013 (reverted in r189906) now that the underlying issue is fixed 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
2013-09-04 22:03:57 +00:00
David Blaikie ab415a4b35 Revert "DebugInfo: Remove explicit declaration-emissiong handling now that 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
2013-09-04 02:12:12 +00:00
Yunzhong Gao 0ebf1bb150 Revert r189649 because it was breaking sanitizer bots.
llvm-svn: 189660
2013-08-30 08:53:09 +00:00
Yunzhong Gao be8d7ba93a Fixing a bug where debug info for a local variable gets emitted at file scope.
The patch was discussed in Phabricator. See:
http://llvm-reviews.chandlerc.com/D1281

llvm-svn: 189649
2013-08-30 05:37:02 +00:00
Manman Ren 1b45702454 Debug Info: update interface for CreateEnumType and getOrCreateRecordFwdDecl.
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
2013-08-28 21:20:28 +00:00
David Blaikie cf2c8b33cd DebugInfo: Remove explicit declaration-emissiong handling now that we have a more principled approach (the 'requires complete type' callback)
No functionality change intended.

llvm-svn: 189013
2013-08-22 13:36:01 +00:00
David Blaikie ce76304627 DebugInfo: comment/inlining based on feedback from Eric & Adrian
llvm-svn: 188834
2013-08-20 21:49:21 +00:00
David Blaikie 8d5e128bd4 DebugInfo: Simplify/clarify propagation of typemembers between declaration and definition
Based on code review feedback from Eric Christopher (on r188739) and
Adrian Prantl (r188642).

llvm-svn: 188829
2013-08-20 21:03:29 +00:00
David Blaikie 6943dea321 Revert "Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic 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
2013-08-20 01:28:15 +00:00
Michael Gottesman 349542b171 Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in 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
2013-08-19 18:46:16 +00:00
David Blaikie 25b2085490 Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that 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
2013-08-18 17:59:12 +00:00
David Blaikie adfbf993d6 DebugInfo: Don't emit vbase 'containing types' for context chain limited types
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
2013-08-18 16:55:33 +00:00
David Blaikie 7d5d7c7e90 Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class"
This reverts commit r188576.

Reverting while I investigate a selfhosting buildbot failure on Darwin.

llvm-svn: 188600
2013-08-17 00:06:55 +00:00
David Blaikie 9eddbbd563 DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class
This reduces Clang's .dwo (fission debug info) size by 23% over
Clang+LLVM.

llvm-svn: 188576
2013-08-16 20:40:29 +00:00
David Blaikie ab255bb9cf DebugInfo: Contrain the record type parameter for CollectRecordFields
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
2013-08-16 20:40:25 +00:00
Evgeniy Stepanov 37b3f73690 Revert r188498.
This change broke release+asserts build with compiler-rt.

llvm-svn: 188539
2013-08-16 10:35:31 +00:00
David Blaikie ae01946afa DebugInfo: CollectRecordStaticField -> CreateRecordStaticField to return its result.
llvm-svn: 188501
2013-08-15 22:50:29 +00:00
David Blaikie 6dc689670c DebugInfo: Split out the implementation of getStaticDataMemberDeclaration for future use
llvm-svn: 188498
2013-08-15 22:30:23 +00:00
David Blaikie a0ef9fa6bf DebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type match the semantics
Rather than having a cast immediately inside the function, push that
type requirement out to the callers.

llvm-svn: 188492
2013-08-15 21:42:43 +00:00
David Blaikie b2e86eb64a DebugInfo: Unify & optimize the lazy addition of record types
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
2013-08-15 20:49:17 +00:00
David Blaikie 4e7ef80e68 DebugInfo: Revert change to the return type of createRecordFwdDecl
It still does only return DICompositeType, but I've no need to make that
change right now.

llvm-svn: 188482
2013-08-15 20:17:25 +00:00
David Blaikie d816e2d3b0 DebugInfo: Don't create duplicate forward declaration metadata unnecessarily.
No functionality change, at best a slight (questionable) optimization,
but necessary for correctness of future work.

llvm-svn: 188474
2013-08-15 18:59:40 +00:00
David Blaikie 4a2b5ef603 DebugInfo: simplify some limited/declaration creation APIs
llvm-svn: 188214
2013-08-12 22:24:20 +00:00
Adrian Prantl 12bdde57a9 typo.
llvm-svn: 187089
2013-07-25 00:23:37 +00:00
Adrian Prantl 49a78563d2 Debug Info: Fix an oversight of r186553. Ensure that the function prologue
of an artificial function gets an artificial location as well.

llvm-svn: 187074
2013-07-24 20:34:39 +00:00
Adrian Prantl b75016d299 s/BuiltinLocation/ArtificialLocation/
llvm-svn: 186557
2013-07-18 01:36:04 +00:00
Adrian Prantl 2e0637ff63 Replace llvm::DIBuilder::DisableDebugLocations() with two RAII interfaces
inspired by CodegenFunction::LexicalScope.
- NoLocation temporarily turns off debug locations altogether.
  This is useful for emitting instructions that should be
  counted towards the function prologue.
- BuiltinLocation temporarily switches to an artificial debug location
  that has a valid scope, but no line information. This is useful when
  emitting compiler-generated helper functions that have no source
  location associated with them.

llvm-svn: 186552
2013-07-18 00:28:02 +00:00
Eric Christopher e9348f6df5 Reformat line.
llvm-svn: 186294
2013-07-14 21:15:27 +00:00
Eric Christopher 324bbbd16a Move BlockLiteralGeneric earlier in CGDebugInfo and remove
BlockLiteralGenericSet and replace with a call to isType() on the
BlockLiteralGeneric.

llvm-svn: 186293
2013-07-14 21:12:44 +00:00
David Blaikie 47c1150f50 DebugInfo: Support (using GNU extensions) for template template parameters and parameter packs
llvm-svn: 184644
2013-06-22 18:59:18 +00:00
David Blaikie f7bcb0c279 Fix all the silly things I committed in r184509
llvm-svn: 184512
2013-06-21 00:59:44 +00:00
David Blaikie b8f2fbbe97 Alternative fix for r184473.
This just seems a bit tidier/more principled. Based on a patch provided
by Adrian - with the only minor tweak that it needed to use
"getTypeOrNull" rather than "getCompletedTypeOrNull" since we don't
store declarations in the CompletedTypes cache.

No intended functionality change.

llvm-svn: 184509
2013-06-21 00:40:50 +00:00
David Blaikie e36464c2f6 PR16214: Debug Info: -flimit-debug-info doesn't omit definitions for types used via typedefs
In an effort to make -flimit-debug-info more consistent I over-shot the
mark & made types used via typedefs never produce definitions in the
debug info (even if the type was used in a way that would require a
definition).

The fix for this is to do exactly what I was hoping to do at some point
- plumb the declaration/definition choice through the various layers of
"CreateType" in CGDebugInfo. In this way we can produce declarations
whenever they are sufficient & definitions otherwise - including when
qualifiers are used, for example (discovered in PR14467). This may not
be complete (there may be other types/situations where we need to
propagate the "declaration/definition" choice) but it lays the basic
foundation which we can enhance in future iterations.

llvm-svn: 183296
2013-06-05 05:32:23 +00:00
David Blaikie 4583bea0b2 DebugInfo: Rename CreatePointerType to getOrCreateTypeDeclaration
To make this more consistent with 'getOrCreateType' & clarify the
distinction between the two. The only thing I couldn't quite communicate
in the name is that getOrCreateTypeDeclaration may actually produce a
full definition (in -fno-limit-debug-info) but the point is to call it
whenever only a declaration is needed & the implementation can choose
whether to provide a declaration or definition.

(also, unfortunately, getOrCreateType can produce declarations too - we
should sure this up by making it not do that - any caller that can
tolerate a declaration should be calling getOrCreateTypeDeclaration
instead)

llvm-svn: 182674
2013-05-24 21:33:22 +00:00
David Blaikie 469f07969e Debug Info: Handle function/method types using the most specific type
llvm-svn: 182533
2013-05-22 23:22:42 +00:00
David Blaikie f121b9302e PR14606: Debug Info for namespace aliases/DW_TAG_imported_module
This resolves the last of the PR14606 failures in the GDB 7.5 test
suite. (but there are still unresolved issues in the imported_decl case
- we need to implement optional/lazy decls for functions & variables
like we already do for types)

llvm-svn: 182329
2013-05-20 22:50:41 +00:00
Eric Christopher cbf5701f93 Make this const since it never changes (and should never change).
llvm-svn: 182309
2013-05-20 19:59:06 +00:00