summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DIBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_typeManman Ren2013-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 191800
* Debug Info: constify and rename from generateRef to getRef.Manman Ren2013-09-301-7/+7
| | | | | | No functionality change. llvm-svn: 191696
* Debug Info: In DIBuilder, the context fields of a TAG_inheritance and aManman Ren2013-09-091-2/+2
| | | | | | | | TAG_friend are updated to use scope reference. Added testing cases to verify that class with inheritance can be uniqued. llvm-svn: 190364
* Debug Info: Use DIScopeRef for DIType::getContext.Manman Ren2013-09-091-1/+1
| | | | | | | | | | | | | | | | | 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. llvm-svn: 190334
* Revert r190269 to fix dragonegg failures.Manman Ren2013-09-081-1/+1
| | | | llvm-svn: 190271
* Debug Info: use null instead of "i32 0" in DIBuilder.Manman Ren2013-09-081-13/+5
| | | | | | For context field of subroutine_type and when creating artificial types. llvm-svn: 190270
* Debug Info: pass in DIScope instead of DIDescriptor in createMemberType.Manman Ren2013-09-081-1/+1
| | | | | | Improve readability. No functionality change. llvm-svn: 190269
* Debug Info: Use identifier to reference DIType in containing type field ofManman Ren2013-09-071-1/+1
| | | | | | | | a DISubprogram. Verifier is updated accordingly. llvm-svn: 190229
* Debug Info: pass in VTableHolder as DIType instead of MDNode *.Manman Ren2013-09-061-5/+5
| | | | | | Remove one cast and improve readability. No functionality change. llvm-svn: 190225
* Debug Info: Use identifier to reference DIType in containing type field ofManman Ren2013-09-061-2/+2
| | | | | | | | a DICompositeType. Verifier is updated accordingly. llvm-svn: 190190
* Debug Info: Move a helper function getTypeIdentifier from DIBuilder to be partManman Ren2013-09-061-13/+1
| | | | | | | | | | | 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. llvm-svn: 190188
* Debug Info: Use identifier to reference DIType in base type field ofManman Ren2013-09-051-1/+13
| | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 190081
* DIBuilder: retain a type when created with a unique identifier.Manman Ren2013-08-291-3/+23
| | | | | | | | | | | | | | | 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. llvm-svn: 189621
* DIBuilder: take an optional StringRef to pass in unique identifier.Manman Ren2013-08-271-10/+14
| | | | | | | | createClassType, createStructType, createUnionType, createEnumerationType, and createForwardDecl will take an optional StringRef to pass in the unique identifier. llvm-svn: 189410
* Debug Info: add an identifier field to DICompositeType.Manman Ren2013-08-261-8/+21
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 189282
* DebugInfo: Allow the addition of other (such as static data) members to a ↵David Blaikie2013-08-161-4/+5
| | | | | | | | record type after construction Plus a type cleanup & minor fix to enumerate members of declarations. llvm-svn: 188577
* Make sure that if we're going to attempt to add a type to a DIE thatEric Christopher2013-08-081-1/+0
| | | | | | | | | | | | 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. llvm-svn: 187963
* Remove DIBuilder cache of variable TheCU and change the fewEric Christopher2013-07-191-14/+18
| | | | | | | uses that wanted it. Also change the interface for createCompileUnit to compensate. Fix comments that refer to TheCU as well. llvm-svn: 186637
* Revert "Remove DIBuilder cache of variable TheCU and change the few"Eric Christopher2013-07-181-18/+14
| | | | | | This reverts commit r186599 as I didn't want to commit this yet. llvm-svn: 186601
* Remove DIBuilder cache of variable TheCU and change the fewEric Christopher2013-07-181-14/+18
| | | | | | | uses that wanted it. Also change the interface for createCompileUnit to compensate. Fix comments that refer to TheCU as well. llvm-svn: 186599
* Debug Info: cleanupManman Ren2013-07-021-4/+6
| | | | llvm-svn: 185456
* Debug Info: clean up usage of Verify.Manman Ren2013-07-011-16/+18
| | | | | | | No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. llvm-svn: 185383
* Debug Info: clean up usage of Verify.Manman Ren2013-06-291-4/+8
| | | | | | | | | No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. For cases where we know the type of a DI metadata, use assert. llvm-svn: 185249
* Rename DIBuilder::createNullPtrType to createUnspecifiedType and introducePeter Collingbourne2013-06-271-4/+9
| | | | | | | | | a zero-argument createNullPtrType function for creating the canonical nullptr type. Differential Revision: http://llvm-reviews.chandlerc.com/D1050 llvm-svn: 185114
* s/C++0x/C++11/Adrian Prantl2013-06-251-1/+1
| | | | llvm-svn: 184892
* typo.Adrian Prantl2013-06-241-1/+1
| | | | llvm-svn: 184783
* DebugInfo: DIBuilder changes to match DIEnumerator changes in r184694David Blaikie2013-06-241-1/+1
| | | | | | | | Representing enumerators by int64 instead of uint64 for now. At some point we need to address the underlying issue of representation depending on the specific enumeration. llvm-svn: 184761
* DebugInfo: Support (using GNU extensions) for template template parameters ↵David Blaikie2013-06-221-6/+37
| | | | | | and parameter packs llvm-svn: 184643
* DIBuilder: No functionality change.Manman Ren2013-06-071-23/+26
| | | | | | Use the correct DIType when creating types in DIBuilder. llvm-svn: 183543
* DIBuilder: No functionality change.Manman Ren2013-06-071-3/+3
| | | | | | Use the correct DIType when creating vector types. llvm-svn: 183484
* Solidify the assumption that a DW_TAG_subprogram's type is a ↵David Blaikie2013-05-221-2/+6
| | | | | | | | | | | | | DW_TAG_subroutine_type There were bits & pieces of code lying around that may've given the impression that debug info metadata supported the possibility that a subprogram's type could be specified by a non-subroutine type describing the return type of a void function. This support was incomplete & unnecessary. Asserts & API have been changed to make the desired usage more clear. llvm-svn: 182532
* PR14606: Debug Info for namespace aliases/DW_TAG_imported_moduleDavid Blaikie2013-05-201-10/+39
| | | | | | | | | This resolves the last of the PR14606 failures in the GDB 7.5 test suite by implementing an optional name field for DW_TAG_imported_modules/DIImportedEntities and using that to implement C++ namespace aliases (eg: "namespace X = Y;"). llvm-svn: 182328
* PR14492: Debug Info: Support for values of non-integer non-type template ↵David Blaikie2013-05-101-2/+2
| | | | | | | | | | parameters. This is only tested for global variables at the moment (& includes tests for the unnamed parameter case, since apparently this entire function was completely untested previously) llvm-svn: 181632
* Rename DIImportedModule to DIImportedEntity and allow imported declarationsDavid Blaikie2013-05-071-2/+17
| | | | | | | | | DIBuilder::createImportedDeclaration isn't fully plumbed through (note, lacking in AsmPrinter/DwarfDebug support) but this seemed like a sufficiently useful division of code to make the subsequent patch(es) easier to follow. llvm-svn: 181364
* Revert "Revert "PR14606: debug info imported_module support""David Blaikie2013-04-221-0/+21
| | | | | | | | | | This reverts commit r179840 with a fix to test/DebugInfo/two-cus-from-same-file.ll I'm not sure why that test only failed on ARM & MIPS and not X86 Linux, even though the debug info was clearly invalid on all of them, but this ought to fix it. llvm-svn: 179996
* 80-col fixup.Eric Christopher2013-04-191-1/+2
| | | | llvm-svn: 179881
* Rename ClassType to the more accurate UnderlyingType and document its purpose.Adrian Prantl2013-04-191-3/+3
| | | | | | rdar://problem/13463793 llvm-svn: 179877
* Revert "PR14606: debug info imported_module support"Eric Christopher2013-04-191-21/+0
| | | | | | This reverts commit r179836 as it seems to have caused test failures. llvm-svn: 179840
* PR14606: debug info imported_module supportDavid Blaikie2013-04-191-0/+21
| | | | | | | | | | Adding another CU-wide list, in this case of imported_modules (since they should be relatively rare, it seemed better to add a list where each element had a "context" value, rather than add a (usually empty) list to every scope). This takes care of DW_TAG_imported_module, but to fully address PR14606 we'll need to expand this to cover DW_TAG_imported_declaration too. llvm-svn: 179836
* Support and test template arguments for unions.Eric Christopher2013-04-021-1/+2
| | | | llvm-svn: 178586
* Reformat arguments.Eric Christopher2013-04-021-4/+6
| | | | llvm-svn: 178585
* Revert "Adding DIImportedModules to DIScopes."David Blaikie2013-03-281-109/+29
| | | | | | | | | This reverts commit 342d92c7a0adeabc9ab00f3f0d88d739fe7da4c7. Turns out we're going with a different schema design to represent DW_TAG_imported_modules so we won't need this extra field. llvm-svn: 178215
* Adding DIImportedModules to DIScopes.David Blaikie2013-03-271-29/+109
| | | | | | | | | | | | This is just the basic groundwork for supporting DW_TAG_imported_module but I wanted to commit this before pushing support further into Clang or LLVM so that this rather churny change is isolated from the rest of the work. The major churn here is obviously adding another field (within the common DIScope prefix) to all DIScopes (files, classes, namespaces, lexical scopes, etc). This should be the last big churny change needed for DW_TAG_imported_module/using directive support/PR14606. llvm-svn: 178099
* Make DIBuilder::createClassType more type safe by returning DICompositeType ↵David Blaikie2013-03-261-8/+10
| | | | | | rather than DIType llvm-svn: 178091
* Swap the DIFile in DILexicalBlockFile out for the raw name/directory pairDavid Blaikie2013-03-221-1/+1
| | | | | | This is the last change in transitioning all DIScopes to have a common prefix. llvm-svn: 177756
* reorder the fields in DILexicalBlockFile to match the common prefix for DIScopesDavid Blaikie2013-03-221-2/+2
| | | | llvm-svn: 177754
* Refactor out the DIFile parameter to DILexicalBlock to refer to the raw ↵David Blaikie2013-03-221-1/+1
| | | | | | file/directory pair llvm-svn: 177742
* Reorder the DIFile field in DILexicalBlock to become a prefix common with ↵David Blaikie2013-03-221-1/+1
| | | | | | other DIScopes llvm-svn: 177703
* Refactor the filename/directory information in DISubprogram to refer ↵David Blaikie2013-03-211-2/+2
| | | | | | directly to the pair rather than the DIFile. llvm-svn: 177677
* Move the DIFile in DISubprogram to the beginning to be a common prefix along ↵David Blaikie2013-03-211-2/+2
| | | | | | with other DIScopes llvm-svn: 177674
OpenPOWER on IntegriCloud