summaryrefslogtreecommitdiff
path: root/lib/IR/DIBuilder.cpp
Commit message (Collapse)AuthorAge
* Add new debug kind LocTrackingOnly.Diego Novillo2014-06-24
| | | | | | | | | | | | | | | | | | | | | | | | 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 (-pass-remarks, -pass-remarks-missed and -pass-remarks-analysis). To prevent debug info emission, DIBuilder never inserts the annotation 'llvm.dbg.cu' when LocTrackingOnly is enabled. Reviewers: echristo, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D4234 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211609 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Add FIXME regarding DILexicalBlock uniquing fields.David Blaikie2014-05-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208909 91177308-0d34-0410-b5e6-96231b3b80d8
* PR19562: DebugInfo temporary MDNode leak: Don't include a temporary node to ↵David Blaikie2014-05-07
| | | | | | | | | | replace with a variable list for methods, since they're always declarations and thus never include variables This field is used for a list of variables to ensure they are not lost during optimization (they're only included when optimizations are enabled). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208159 91177308-0d34-0410-b5e6-96231b3b80d8
* PR19598: Provide the ability to RAUW a declaration with itself, creating a ↵David Blaikie2014-05-06
| | | | | | | | | | | | | non-temporary copy and using that to RAUW. Also, provide the ability to create temporary and non-temporary declarations, as not all declarations may be replaced by definitions later on. This provides the necessary infrastructure for Clang to fix PR19598, leaking temporary MDNodes in Clang's debug info generation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208054 91177308-0d34-0410-b5e6-96231b3b80d8
* PR19623: Implement typedefs of void.David Blaikie2014-05-01
| | | | | | | | This the LLVM portion that will allow Clang and other frontends to emit typedefs of void by providing a null type for the typedef's underlying type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207777 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify the assertion in DIBuilder.cpp to cover the DWARF 5 languagesPeter Collingbourne2014-04-28
| | | | | | Differential Revision: http://reviews.llvm.org/D3523 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207428 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper2014-04-09
| | | | | | check instead of comparing to nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205831 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Support namespace aliases as DW_TAG_imported_declaration instead ↵David Blaikie2014-04-06
| | | | | | | | | | | | | | | | of DW_TAG_imported_module I really should read the spec more often (and test GCC more often too). I just assumed that namespace aliases would be the same as using directives, except with a name. But apparently that's not how the DWARF standards suggests they be implemented. DWARF4 provides an example and other non-normative text suggesting that namespace aliases be implemented by named imported declarations intsead of named imported modules. So be it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205685 91177308-0d34-0410-b5e6-96231b3b80d8
* LTO type uniquing: store the Decl field of a DIImportedEntity as a DIRef.Adrian Prantl2014-04-01
| | | | | | | | | | No other functionality changes, DIBuilder testcase is included in a paired CFE commit. This relaxes the assertion in isScopeRef to also accept subclasses of DIScope. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205279 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the type field in DIVariable and DIGlobalVariable over to DITypeRefs.Adrian Prantl2014-03-18
| | | | | | | | | This allows us to catch more opportunities for ODR-based type uniquing during LTO. Paired commit with CFE which updates some testcases to verify the new DIBuilder behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204106 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Move DebugInfo.h into the IR library where its implementationChandler Carruth2014-03-06
| | | | | | already lives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203046 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Move DIBuilder.h into the IR library where its implementationChandler Carruth2014-03-06
| | | | | | already lives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203038 91177308-0d34-0410-b5e6-96231b3b80d8
* Add DWARF discriminator support to DILexicalBlocks.Diego Novillo2014-03-03
| | | | | | This adds support for emitting discriminators from DILexicalBlocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202736 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix >> to be > > for non-c++11.Eric Christopher2014-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202545 91177308-0d34-0410-b5e6-96231b3b80d8
* 80-col.Eric Christopher2014-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202541 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crasher where when we're attempting to replace a typeEric Christopher2014-02-28
| | | | | | | | | | during the finalization for CGDebugInfo in clang we would RAUW a type and it would result in a corrupted MDNode for an imported declaration. Testcase pending as reducing has been difficult. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202540 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a debug info code generation level to the compile unit metadataEric Christopher2014-02-27
| | | | | | | | | | and update everything accordingly. This can be used to conditionalize the amount of output in the backend based on the amount of debug requested/metadata emission scheme by a front end (e.g. clang). Paired with a commit to clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202332 91177308-0d34-0410-b5e6-96231b3b80d8
* DIBuilder: simplify array generation to produce true zero-length arraysDavid Blaikie2014-02-03
| | | | | | | | | | | | For some anachronistic reason we were producing {i32 0} for zero-length debug info arrays. (this change is paired with a Clang change and may cause temporary buildbot noise) Let's not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200721 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Implement (rvalue) reference qualifiers for C++11 non-staticAdrian Prantl2013-12-18
| | | | | | | | member functions. Paired commit with CFE. rdar://problem/15356637 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197613 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Simplify a few more explicit constructions, underconstrained ↵David Blaikie2013-11-18
| | | | | | types, and make DIType(MDNode*) explicit like all the other DI* node ctors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195055 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an assert that we have a scope that matters for methodsEric Christopher2013-10-15
| | | | | | | and remove a call to getNonCompileUnitScope as a method shouldn't be in the compile unit scope. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192748 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up, formatting, comments. No functional change.Eric Christopher2013-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192747 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: In DIBuilder, the context field of subprogram is updated to useManman Ren2013-10-10
| | | | | | | | | DIScopeRef. A paired commit at clang is required due to changes to DIBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192378 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: In DIBuilder, the context and type fields of template_type andManman Ren2013-10-09
| | | | | | | | | template_value are updated to use DIRef. A paired commit at clang is required due to changes to DIBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192320 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: In DIBuilder, the context field of a forward decl is updatedManman Ren2013-10-09
| | | | | | | to use DIScopeRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192309 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: In DIBuilder, the context field of a DICompositeType is updatedManman Ren2013-10-09
| | | | | | | | | to use DIScopeRef. A paired commit at clang is required due to changes to DIBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192256 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: In DIBuilder, the context fields of a static member and aManman Ren2013-10-08
| | | | | | | typedef are updated to use DIScopeRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192254 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: In DIBuilder, the derived-from field of DICompositeTypeManman Ren2013-10-08
| | | | | | | | | is updated to use DITypeRef. A paired commit at clang is required due to changes to DIBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192251 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: In DIBuilder, the derived-from field of DIDerivedTypeManman Ren2013-10-08
| | | | | | | | | is updated to use DITypeRef. A paired commit at clang is required due to changes to DIBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192246 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_typeManman Ren2013-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | is updated to use DITypeRef. Move isUnsignedDIType and getOriginalTypeSize from DebugInfo.h to be static helper functions in DwarfCompileUnit. We already have a static helper function "isTypeSigned" in DwarfCompileUnit, and a pointer to DwarfDebug is added to resolve the derived-from field. All three functions need to go across link for derived-from fields, so we need to get hold of a type identifier map. A pointer to DwarfDebug is also added to DbgVariable in order to resolve the derived-from field. Debug info verifier is updated to check a derived-from field is a TypeRef. Verifier will not go across link for derived-from fields, in debug info finder, we go across the link to add derived-from fields to types. Function getDICompositeType is only used by dragonegg and since dragonegg does not generate identifier for types, we use an empty map to resolve the derived-from field. When printing a derived-from field, we use DITypeRef::getName to either return the type identifier or getName of the DIType. A paired commit at clang is required due to changes to DIBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192018 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r191792 as it is causing some LTO debug failuresEric Christopher2013-10-04
| | | | | | | on platforms with relocations in debug info and also temporarily revert r191800 due to conflicts with the revert of r191792. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191967 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_typeManman Ren2013-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | is updated to use DITypeRef. Move isUnsignedDIType and getOriginalTypeSize from DebugInfo.h to be static helper functions in DwarfCompileUnit. We already have a static helper function "isTypeSigned" in DwarfCompileUnit, and a pointer to DwarfDebug is added to resolve the derived-from field. All three functions need to go across link for derived-from fields, so we need to get hold of a type identifier map. A pointer to DwarfDebug is also added to DbgVariable in order to resolve the derived-from field. Debug info verifier is updated to check a derived-from field is a TypeRef. Verifier will not go across link for derived-from fields, in debug info finder, we go across the link to add derived-from fields to types. Function getDICompositeType is only used by dragonegg and since dragonegg does not generate identifier for types, we use an empty map to resolve the derived-from field. When printing a derived-from field, we use DITypeRef::getName to either return the type identifier or getName of the DIType. A paired commit at clang is required due to changes to DIBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191800 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: constify and rename from generateRef to getRef.Manman Ren2013-09-30
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191696 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: In DIBuilder, the context fields of a TAG_inheritance and aManman Ren2013-09-09
| | | | | | | | | TAG_friend are updated to use scope reference. Added testing cases to verify that class with inheritance can be uniqued. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190364 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Use DIScopeRef for DIType::getContext.Manman Ren2013-09-09
| | | | | | | | | | | | | | | | | | In DIBuilder, the context field of a TAG_member is updated to use the scope reference. Verifier is updated accordingly. DebugInfoFinder now needs to generate a type identifier map to have access to the actual scope. Same applies for BreakpointPrinter. processModule of DebugInfoFinder is called during initialization phase of the verifier to make sure the type identifier map is constructed early enough. We are now able to unique a simple class as demonstrated by the added testing case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190334 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r190269 to fix dragonegg failures.Manman Ren2013-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190271 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: use null instead of "i32 0" in DIBuilder.Manman Ren2013-09-08
| | | | | | | For context field of subroutine_type and when creating artificial types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190270 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: pass in DIScope instead of DIDescriptor in createMemberType.Manman Ren2013-09-08
| | | | | | | Improve readability. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190269 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Use identifier to reference DIType in containing type field ofManman Ren2013-09-07
| | | | | | | | | a DISubprogram. Verifier is updated accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190229 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: pass in VTableHolder as DIType instead of MDNode *.Manman Ren2013-09-06
| | | | | | | Remove one cast and improve readability. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190225 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Use identifier to reference DIType in containing type field ofManman Ren2013-09-06
| | | | | | | | | a DICompositeType. Verifier is updated accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190190 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Move a helper function getTypeIdentifier from DIBuilder to be partManman Ren2013-09-06
| | | | | | | | | | | | of DIType. Implement DIType::generateRef to return a type reference. This function will be used in setContaintingType and in DIBuilder to generete the type reference. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190188 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Use identifier to reference DIType in base type field ofManman Ren2013-09-05
| | | | | | | | | | | | | | | | | | | | | | | ptr_to_member. We introduce a new class DITypeRef that represents a reference to a DIType. It wraps around a Value*, which can be either an identifier in MDString or an actual MDNode. The class has a helper function "resolve" that finds the actual MDNode for a given DITypeRef. We specialize getFieldAs to return a field that is a reference to a DIType. To correctly access the base type field of ptr_to_member, getClassType now calls getFieldAs<DITypeRef> to return a DITypeRef. Also add a typedef for DITypeIdentifierMap and a helper generateDITypeIdentifierMap in DebugInfo.h. In DwarfDebug.cpp, we keep a DITypeIdentifierMap and call generateDITypeIdentifierMap to actually populate the map. Verifier is updated accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190081 91177308-0d34-0410-b5e6-96231b3b80d8
* DIBuilder: retain a type when created with a unique identifier.Manman Ren2013-08-29
| | | | | | | | | | | | | | | | createClassType, createStructType, createUnionType, createEnumerationType, and createForwardDecl will retain a type when created with a unique identifier, to make sure they are treated as used even when all uses are replaced with the identifiers. Use TrackingVH<MDNode> instead of MDNode in AllRetainTypes, since the created node can later be updated. The change will be tested when clients of DIBuilder start to pass in non-empty unique identifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189621 91177308-0d34-0410-b5e6-96231b3b80d8
* DIBuilder: take an optional StringRef to pass in unique identifier.Manman Ren2013-08-27
| | | | | | | | | | createClassType, createStructType, createUnionType, createEnumerationType, and createForwardDecl will take an optional StringRef to pass in the unique identifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189410 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: add an identifier field to DICompositeType.Manman Ren2013-08-26
| | | | | | | | | | | | | | | | | | | DICompositeType will have an identifier field at position 14. For now, the field is set to null in DIBuilder. For DICompositeTypes where the template argument field (the 13th field) was optional, modify DIBuilder to make sure the template argument field is set. Now DICompositeType has 15 fields. Update DIBuilder to use NULL instead of "i32 0" for null value of a MDNode. Update verifier to check that DICompositeType has 15 fields and the last field is null or a MDString. Update testing cases to include an extra field for DICompositeType. The identifier field will be used by type uniquing so a front end can genearte a DICompositeType with a unique identifer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189282 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Allow the addition of other (such as static data) members to a ↵David Blaikie2013-08-16
| | | | | | | | record type after construction Plus a type cleanup & minor fix to enumerate members of declarations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188577 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that if we're going to attempt to add a type to a DIE thatEric Christopher2013-08-08
| | | | | | | | | | | | the type exists. Fix up cases where we weren't checking for optional types and add an assert to addType to make sure we catch this in the future. Fix up a testcase that was using the tag for DW_TAG_array_type when it meant DW_TAG_enumeration_type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187963 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove DIBuilder cache of variable TheCU and change the fewEric Christopher2013-07-19
| | | | | | | uses that wanted it. Also change the interface for createCompileUnit to compensate. Fix comments that refer to TheCU as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186637 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Remove DIBuilder cache of variable TheCU and change the few"Eric Christopher2013-07-18
| | | | | | This reverts commit r186599 as I didn't want to commit this yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186601 91177308-0d34-0410-b5e6-96231b3b80d8