summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* DebugInfo: Don't include member function template specializations in the ↵David Blaikie2014-10-061-10/+0
| | | | | | | | | | 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
* DIBuilder: Encapsulate DIExpression's element typeDuncan P. N. Exon Smith2014-10-011-18/+16
| | | | | | | Update for corresponding LLVM API change for `DIBuilder::createExpression()`. llvm-svn: 218798
* Update CGDebugInfo to the updated API in LLVM.Adrian Prantl2014-10-011-21/+25
| | | | | | | | | | Complex address expressions are no longer part of DIVariable, but rather an extra argument to the debug intrinsics. http://reviews.llvm.org/D4919 rdar://problem/17994491 llvm-svn: 218788
* Reverting r218777 while investigating buildbot breakage.Adrian Prantl2014-10-011-25/+21
| | | | | | "Update CGDebugInfo to the updated API in LLVM." llvm-svn: 218781
* Update CGDebugInfo to the updated API in LLVM.Adrian Prantl2014-10-011-21/+25
| | | | | | | | | | Complex address expressions are no longer part of DIVariable, but rather an extra argument to the debug intrinsics. http://reviews.llvm.org/D4919 rdar://problem/17994491 llvm-svn: 218777
* Remove dead code from DIBuilderJyoti Allur2014-09-291-3/+3
| | | | llvm-svn: 218593
* Include debug info for types referenced only via explicit cast expressions.David Blaikie2014-09-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | Most of the debug info emission is powered essentially from function definitions - if we emit the definition of a function, we emit the types of its parameters, the members of those types, and so on and so forth. For types that aren't referenced even indirectly due to this - because they only appear in temporary expressions, not in any named variable, we need to explicitly emit/add them as is done here. This is not the only case of such code, and we might want to consider handling "void func(void*); ... func(new T());" (currently debug info for T is not emitted) at some point, though GCC doesn't. There's a much broader solution to these issues, but it's a lot of work for possibly marginal gain (but might help us improve the default -fno-standalone-debug behavior to be even more aggressive in some places). See the original review thread for more details. Patch by jyoti allur (jyoti.yalamanchili@gmail.com)! Differential Revision: http://reviews.llvm.org/D2498 llvm-svn: 218390
* Debug info: Only emit C++ accessibility specifiers when they are divergingAdrian Prantl2014-08-291-37/+46
| | | | | | | | from the default for the containing type. rdar://problem/18154959 llvm-svn: 216800
* [C++11] Support for capturing of variable length arrays in lambda expression.Alexey Bataev2014-08-281-2/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D4368 llvm-svn: 216649
* Update for LLVM API change to remove discriminator tracking from ↵David Blaikie2014-08-211-2/+1
| | | | | | DILexicalBlock (in favor of DILexicalBlockFile - where a default arg is used to avoid the need for API churn of those callers) llvm-svn: 216240
* Debuginfo: Correctly tag variadic ObjC methods with ↵Frederic Riss2014-08-121-0/+3
| | | | | | | | DW_TAG_unspecified_parameter. Fixes rdar://13690847 llvm-svn: 215423
* DebugInfo: Blocks: Do not depend on LLVM argument numbering when choosing ↵David Blaikie2014-08-081-1/+2
| | | | | | | | | | | | the debug info argument numbering. Due to the possible presence of return-by-out parameters, using the LLVM argument number count when numbering debug info arguments can end up off-by-one. This could produce two arguments with the same number, which would in turn cause LLVM to emit only one of those arguments (whichever it found last) or assert (r215157). llvm-svn: 215227
* Debug info: Use the vbtable offset for virtual bases in the MS ABIReid Kleckner2014-08-071-5/+12
| | | | | | | | There are no vtable offset offsets in the MS ABI, but vbtable offsets are analogous. There are no consumers of this information yet, but at least we don't crash now. llvm-svn: 215149
* Revert "Debug info: Use record layout to find vbase offsets instead of vtables"Reid Kleckner2014-08-071-1/+3
| | | | | | | | | This reverts commit r215137. This doesn't work at all, an offset-offset is probably different than an offset. I'm scared that this passed our normal test suite. llvm-svn: 215141
* Debug info: Use record layout to find vbase offsets instead of vtablesReid Kleckner2014-08-071-3/+1
| | | | | | | | | This fixes an assertion when generating full debug info in the MS ABI for classes with virtual bases. Fixes PR20579. llvm-svn: 215137
* MS ABI: Consider alignment attributes on typedefs for layoutDavid Majnemer2014-07-301-11/+13
| | | | | | | | | | | | | | | | | | | The MS ABI has a notion of 'required alignment' for fields; this alignment supercedes pragma pack directives. MSVC takes into account alignment attributes on typedefs when determining whether or not a field has a certain required alignment. Do the same in clang by tracking whether or not we saw such an attribute when calculating the type's bitwidth and alignment. This fixes PR20418. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D4714 llvm-svn: 214274
* [Debug Info] add DISubroutineType and its creation takes DITypeArray.Manman Ren2014-07-281-8/+9
| | | | | | | 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] rename getTypeArray to getElements, setTypeArray to setArrays.Manman Ren2014-07-281-6/+6
| | | | | | This is the paired commit with llvm r214112. llvm-svn: 214113
* Add new debug kind LocTrackingOnly.Diego Novillo2014-06-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This new debug emission kind supports emitting line location information in all instructions, but stops code generation from emitting debug info to the final output. This mode is useful when the backend wants to track source locations during code generation, but it does not want to produce debug info. This is currently used by optimization remarks (-Rpass, -Rpass-missed and -Rpass-analysis). When one of the -Rpass flags is used, the front end will enable location tracking, only if no other debug option is enabled. To prevent debug information from being generated, a new debug info kind LocTrackingOnly causes DIBuilder::createCompileUnit() to not emit the llvm.dbg.cu annotation. This blocks final code generation from generating debug info in the back end. Depends on D4234. Reviewers: echristo, dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4235 llvm-svn: 211610
* Delete apparently unused methodAlexey Samsonov2014-06-021-26/+0
| | | | llvm-svn: 210047
* CGDebugInfo: Simplify/invert createLexicalBlock parameter construction.David Blaikie2014-06-021-8/+5
| | | | llvm-svn: 210033
* [C++11] Use 'nullptr'. CodeGen edition.Craig Topper2014-05-211-14/+14
| | | | llvm-svn: 209272
* DebugInfo: Avoid creating DILexicalScopeFiles when the filename in the ↵David Blaikie2014-05-141-7/+11
| | | | | | | | | | | | | | | | | | | current scope has not changed. This looks like the right way for this check to work, but there is another semi-obvious bug, I would think: why is CurLoc not zero'd out between functions? The possibility for it to bleed between them seems problematic. (& indeed I caused tests to fail when I fixed this a different way, by setting CurLoc to SourceLocation() and the end of EmitFunctionEnd... ) The changes to debug-info-blocks.m are due to a mismatch between the source manager's file naming and CGDebugInfo's default handling when no -main-file-name is specified. This actually reveals somewhat of a bug in the debug info when using source files from standard in, too. See the comment in CGDebugInfo::CreateCompileUnit for more details. llvm-svn: 208742
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-101-1/+1
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* PR19562: Fix another temporary node leak in Clang debug info emissionDavid Blaikie2014-05-071-10/+10
| | | | | | | | | | | | | | While constructing ObjC Interface types we might create the declaration of some normal C++ types, thus adding things to the ReplaceMap. Make sure we process the ReplaceMap after the ObjC interfaces. In theory we know at this point, since we're at the end of the TU, that we won't be upgrading any declarations to definitions, so we could just construct non-temporary nodes, but that would require extra state in CGDebugInfo to conditionalize the creation of declaration nodes which seems annoying/more work than is appropriate. llvm-svn: 208226
* DebugInfo: Use enum instead of unsignedEd Maste2014-05-071-8/+8
| | | | | | | | This makes debuging DebugInfo generation with LLDB a little more pleasant. Differential Revision: http://reviews.llvm.org/D3626 llvm-svn: 208203
* PR19562: Fix memory leak when ObjC interface types cause the creation of ↵David Blaikie2014-05-071-1/+5
| | | | | | further interfaces. llvm-svn: 208161
* Reapply: DebugInfo: Emit the definition of enums when the definition ↵David Blaikie2014-05-061-0/+29
| | | | | | | | | | | | | | | | | | | preceeds the declaration and initial use. Reverting r208106 to reapply r208065 with a fix for the regression. The issue was that the enum tried to be built even if the declaration hadn't been constructed for debug info - presenting problems for enum templates and typedefs of enums with names for linkage purposes. Original commit message: This regressed a little further 208055 though it was already a little broken. While the requiresCompleteType optimization should be implemented here. Future (possibly near future) work. llvm-svn: 208114
* Revert "DebugInfo: Emit the definition of enums when the definition preceeds ↵David Blaikie2014-05-061-29/+0
| | | | | | | | | | | the declaration and initial use." This is breaking the compiler-rt build. Reverting while I investigate/fix. This reverts commit r208065. llvm-svn: 208106
* DebugInfo: Emit the definition of enums when the definition preceeds the ↵David Blaikie2014-05-061-0/+29
| | | | | | | | | | | | declaration and initial use. This regressed a little further 208055 though it was already a little broken. While the requiresCompleteType optimization should be implemented here. Future (possibly near future) work. llvm-svn: 208065
* PR19598: Ensure temporary metadata nodes used in debug info are destroyed.David Blaikie2014-05-061-38/+32
| | | | | | | | | | | | | | | | | | | CGDebugInfo and DIBuilder were lax in their handling of temporary MDNodes. All temporary nodes need to be deleted, which means they need to be RAUW'd with a permanent node. This was not happening. To ensure this, leverage DIBuilder's new ability to create both permanent and temporary declarations. Ensure all temporary declarations are RAUW'd, even with itself. (DIDescriptor::RAUW handles the case where it is replaced with itself and creates a new, duplicate permanent node to replace itself with) This means that all temporary declarations must be added to the ReplacementMap even if they're never upgraded to definitions - so move the point of insertion into the map to the point of creation of the declarations. llvm-svn: 208055
* Build debug info for ObjC interface types at the end of the translation unit ↵David Blaikie2014-05-051-101/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to ensure all ivars are included. This takes a different approach than the completedType/requiresCompleteType work which relies on AST callbacks to upgrade the type declaration to a definition. Instead, just defer constructing the definition to the end of the translation unit. This works because the definition is never needed by other debug info (so far as I know), whereas the definition of a struct may be needed by other debug info before the end of the translation unit (such as emitting the definition of a member function which must refer to that member function's declaration). If we had a callback for whenever an IVar was added to an ObjC interface we could use that, and remove the need for the ObjCInterfaceCache, which might be nice. (also would need a callback for when it was more than just a declaration so we could get properties, etc). A side benefit is that we also don't need the CompletedTypeCache anymore. Just rely on the declaration-ness of a type to decide whether its definition is yet to be emitted. There's still the PR19562 memory leak, but this should hopefully make that a bit easier to approach. llvm-svn: 208015
* Simplify replacement map by avoiding duplicate values and ensuring the ↵David Blaikie2014-05-051-15/+9
| | | | | | | | | | | | | values it does contain are necessary. Items were being redundantly added to the replacement map (both when the declaration was created, and then again when its definition was constructed) which caused extra handling to be required when walking the map (as elements may've already been replaced due to prior entries). By avoiding adding the duplicates, the checks in the replacement handling can be replaced with assertions. llvm-svn: 208000
* PR19623: Support typedefs (and alias templates) of void.David Blaikie2014-05-011-3/+0
| | | | llvm-svn: 207781
* [Modules] Remove the only use of the DEBUG(...) macro in the compilerChandler Carruth2014-04-211-1/+0
| | | | | | | | parts of Clang. I don't really have any opinion about whether using that macro is good or bad, but its odd that this is the only one, and Eric seemed happy with just nuking it for now. llvm-svn: 206806
* Further simplify r206430.Adrian Prantl2014-04-171-13/+4
| | | | | | rdar://problem/16636569. llvm-svn: 206434
* Debug info: When collecting the parameters of C++ partial templateAdrian Prantl2014-04-171-4/+10
| | | | | | | | | | | | specializations collect all arguments and not just the ones from the class template partial specialization from which this class template specialization was instantiated. The debug info does not represent the partial specialization otherwise and so specialized parameters would go missing. rdar://problem/16636569. llvm-svn: 206430
* Debug info: (Bugfix) Make sure artificial functions like _GLOBAL__I_aAdrian Prantl2014-04-101-21/+12
| | | | | | | | | | | | | | | | are not associated with any source lines. Previously, if the Location of a Decl was empty, EmitFunctionStart would just keep using CurLoc, which would sometimes be correct (e.g., thunks) but in other cases would just point to a hilariously random location. This patch fixes this by completely eliminating all uses of CurLoc from EmitFunctionStart and rather have clients explicitly pass in a SourceLocation for the function header and the function body. rdar://problem/14985269 llvm-svn: 205999
* Add global static variables for anonymous union fields. This makesEric Christopher2014-04-101-6/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sure that a debugger can find them when stepping through code, for example from the included testcase: 12 int test_it() { 13 c = 1; 14 d = 2; -> 15 a = 4; 16 return (c == 1); 17 } 18 (lldb) p a (int) $0 = 2 (lldb) p c (int) $1 = 2 (lldb) p d (int) $2 = 2 and a, c, d are all part of the file static anonymous union: static union { int c; int d; union { int a; }; struct { int b; }; }; Fixes PR19221. llvm-svn: 205952
* DebugInfo: Support type alias templatesDavid Blaikie2014-04-061-4/+35
| | | | | | | | We already got the type alias correct (though I've included a test case here) since Clang represents that like any other typedef - but type alias templates weren't being handled. llvm-svn: 205691
* DebugInfo: emit namespace aliases as named imported declarations instead of ↵David Blaikie2014-04-061-2/+2
| | | | | | | | named imported entities Apparently that's how DWARF4 suggests they be emitted. So let's do that. llvm-svn: 205686
* Reapply r205655, DebugInfo: Place global constants in their appropriate context.David Blaikie2014-04-051-1/+4
| | | | | | | This was reverted in 205664 and seems to be fixed by 205668... though that may be more by accident than anything well founded. llvm-svn: 205669
* DebugInfo: Avoid emitting constnants for every useDavid Blaikie2014-04-051-1/+5
| | | | | | | | While the folding set would deduplicate the nodes themselves and LLVM would handle not emitting the same global twice, it still meant creating a long/redundant list of global variables. llvm-svn: 205668
* Revert "DebugInfo: Place global constants in their appropriate context."David Blaikie2014-04-051-4/+1
| | | | | | | | | This reverts commit r205655. Breaks the compiler-rt build with an assertion failure in LLVM... reverting while I investigate. llvm-svn: 205664
* DebugInfo: Place global constants in their appropriate context.David Blaikie2014-04-041-1/+4
| | | | | | | We also don't need to duplicate the name in the LinkageName field. Just leave it empty. llvm-svn: 205655
* DebugInfo: PR19298: function local const variables duplicated in the root scopeDavid Blaikie2014-04-041-0/+3
| | | | | | | | | | | | | | See the comment for CodeGenFunction::tryEmitAsConstant that describes how in some contexts (lambdas) we must not emit references to the variable, but instead use the constant directly - because of this we end up emitting a constant for the variable, as well as emitting the variable itself. Should we just skip putting the variable on the stack at all and omit the debug info for the constant? It's not clear to me - what if the address of the local is taken? llvm-svn: 205651
* DebugInfo: Include default template arguments in template type namesDavid Blaikie2014-04-021-22/+8
| | | | | | | | | | | | | | | This was committed 4 years ago in 108916 with insufficient testing to explain why the "getTypeAsWritten" case was appropriate. Experience says that it isn't - the presence or absence of an explicit instantiation declaration was causing this code to generate either i<int> or i<int, int>. That didn't seem to be a useful distinction, and omitting the template arguments was destructive to debuggers being able to associate the two types across translation units or across compilers (GCC, reasonably, never omitted the arguments). llvm-svn: 205447
* Partially revert r204517 and fix a different way:Eric Christopher2014-04-011-6/+15
| | | | | | | | | | | | | We don't want to encourage the code to emit a lexical block for a function that needs one in order for the line table to change, we need to grab the line information from the body of the pattern that we were instantiated from, this code should do that. Modify the test case to ensure that we're still looking in the right place for all of the scopes and also that we haven't created a lexical block where we didn't need one. llvm-svn: 205368
* Debug info: fix a crash when emitting IndirectFieldDecls, which wereAdrian Prantl2014-04-011-1/+1
| | | | | | | previously not handled at all. rdar://problem/16348575 llvm-svn: 205331
* Adapt CGDebugInfo to interface changes in DIBuilder/DIImportedEntity.Adrian Prantl2014-04-011-4/+4
| | | | | | | The Decl field in a DIImportedEntity is now a DIRef. Paired commit with LLVM. llvm-svn: 205278
OpenPOWER on IntegriCloud