summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo.h
Commit message (Collapse)AuthorAge
* Merging r196172:Manman Ren2013-12-09
| | | | | | | | | | | | | | ------------------------------------------------------------------------ r196172 | mren | 2013-12-02 16:12:14 -0800 (Mon, 02 Dec 2013) | 4 lines Debug Info: rename getDebugInfoVersionFromModule to getDebugMetadataVersionFromModule. Suggested by Eric. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196823 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r196158:Manman Ren2013-12-09
| | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r196158 | mren | 2013-12-02 13:29:56 -0800 (Mon, 02 Dec 2013) | 12 lines Debug Info: drop debug info via upgrading path if version number does not match. Add a helper function getDebugInfoVersionFromModule to return the debug info version number for a module. "Verifier/module-flags-1.ll" checks for verification errors. It will seg fault when calling getDebugInfoVersionFromModule because of the incorrect format for module flags in the testing case. We make getModuleFlagsMetadata more robust by checking for error conditions. PR17982 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196822 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r195505:Manman Ren2013-12-09
| | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r195505 | mren | 2013-11-22 14:06:31 -0800 (Fri, 22 Nov 2013) | 8 lines Debug Info: move StripDebugInfo from StripSymbols.cpp to DebugInfo.cpp. We can share the implementation between StripSymbols and dropping debug info for metadata versions that do not match. Also update the comments to match the implementation. A follow-on patch will drop the "Debug Info Version" module flag in StripDebugInfo. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196816 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
* Fix forgotten member initialization detected by MSan bootstrap botAlexey Samsonov2013-11-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195003 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: fix typo in function name.Manman Ren2013-11-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194975 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Verifier: enable public functions of Finder to update the type map.Manman Ren2013-11-17
| | | | | | | | | | | We used to depend on running processModule before the other public functions such as processDeclare, processValue and processLocation. We are now relaxing the constraint by adding a module argument to the three functions and letting the three functions to initialize the type map. This will be used in a follow-on patch that collects nodes reachable from a Function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194973 91177308-0d34-0410-b5e6-96231b3b80d8
* Reformat.Eric Christopher2013-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192735 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
* Move DIRef::getName out of line.Manman Ren2013-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192214 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
* Pull this out for a bit of readability.Eric Christopher2013-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191999 91177308-0d34-0410-b5e6-96231b3b80d8
* Reformat.Eric Christopher2013-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191997 91177308-0d34-0410-b5e6-96231b3b80d8
* Formatting.Eric Christopher2013-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191995 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: move class definition of DIRef.Manman Ren2013-09-11
| | | | | | | | | | | | Definition of DIRef used to require the full definition of DIType because of usage of DIType::isType in DIRef::resolve. We now use DIDescriptor::isType instead to remove the requirement and move definition of DIRef before DIType. With this, we can move the definition of DIType::getContext to the header file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190540 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: define a DIRef template.Manman Ren2013-09-10
| | | | | | | | | | | | | | Specialize the constructors for DIRef<DIScope> and DIRef<DIType> to make sure the Value is indeed a scope ref and a type ref. Use DIScopeRef for DIScope::getContext and DIType::getContext and use DITypeRef for getContainingType and getClassType. DIScope::generateRef now returns a DIScopeRef instead of a "Value *" for readability and type safety. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190418 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: move DIScope::getContext back from DwarfDebug.Manman Ren2013-09-09
| | | | | | | | | This partially reverts r190330. DIScope::getContext now returns DIScopeRef instead of DIScope. We construct a DIScopeRef from DIScope when we are dealing with subprogram, lexical block or name space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190362 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
* Debug Info: move DIScope::getContext to DwarfDebug.Manman Ren2013-09-09
| | | | | | | | | | | | | DIScope::getContext is a wrapper function that calls the specific getContext method on each subclass. When we switch DIType::getContext to return DIScopeRef instead of DIScope, DIScope::getContext can no longer return a DIScope without a type identifier map. DIScope::getContext is only used by DwarfDebug, so we move it to DwarfDebug to have easy access to the type identifier map. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190330 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Move isSubprogramContext from DebugInfo to DwarfDebug.Manman Ren2013-09-09
| | | | | | | | | | | This helper function needs the type identifier map when we switch DIType::getContext to return DIScopeRef instead of DIScope. Since isSubprogramContext is used by DwarfDebug only, We move it to DwarfDebug to have easy access to the map. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190325 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Rename DITypeRef to DIScopeRef.Manman Ren2013-09-09
| | | | | | | | | | | | | | | | | | | | | | | A reference to a scope is more general than a reference to a type since DIType is a subclass of DIScope. A reference to a type can be either an identifier for the type or the DIType itself, while a reference to a scope can be either an identifier for the type (when the scope is indeed a type) or the DIScope itself. A reference to a type and a reference to a scope will be resolved in the same way. The only difference is in the verifier when a field is a reference to a type (i.e. the containing type field of a DICompositeType) or a field is a reference to a scope (i.e. the context field of a DIType). This is to get ready for switching DIType::getContext to return DIScopeRef instead of DIScope. Tighten up isTypeRef and isScopeRef to make sure the identifier is not empty and the MDNode is DIType for TypeRef and DIScope for ScopeRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190322 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: 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
* Trying to un-break the bots.Manman Ren2013-09-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190092 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
* 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
* DebugInfo: provide the ability to add members to a class after it has been ↵David Blaikie2013-08-09
| | | | | | | | | | constructed This is necessary to allow Clang to only emit implicit members when there is code generated for them, rather than whenever they are ODR used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188082 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more rigorous about the sizes of forms and attributes.Eric Christopher2013-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187953 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Finder|Verifier: handle DbgLoc attached to instructions.Manman Ren2013-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also remove checking of llvm.dbg.sp since it is not used in generating dwarf. Current state of Finder: DebugInfoFinder tries to list all debug info MDNodes used in a module. To list debug info MDNodes used by an instruction, DebugInfoFinder provides processDeclare, processValue and processLocation to handle DbgDeclareInst, DbgValueInst and DbgLoc attached to instructions. processModule will go through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes used by the CUs. TODO: 1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We need to add a list of variables that are used by DbgDeclareInst and DbgValueInst. 2> MDString fields should be null or isa<MDString> and MDNode fields should be null or isa<MDNode>. We currently use empty string or int 0 to represent null. 3> Go though Verify functions and make sure that they check field types. 4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each testing case has a llvm.dbg.cu. Re-apply r187609 with fix to pass ocaml binding. vmcore.ml generates a debug location with scope being metadata !{}, in verifier we treat this as a null scope. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187812 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert "Debug Info Finder|Verifier: handle DbgLoc attached toEric Christopher2013-08-02
| | | | | | | | instructions." in an attempt to bring back some bots. This reverts commit r187609. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187638 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Finder|Verifier: handle DbgLoc attached to instructions.Manman Ren2013-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | Also remove checking of llvm.dbg.sp since it is not used in generating dwarf. Current state of Finder: DebugInfoFinder tries to list all debug info MDNodes used in a module. To list debug info MDNodes used by an instruction, DebugInfoFinder provides processDeclare, processValue and processLocation to handle DbgDeclareInst, DbgValueInst and DbgLoc attached to instructions. processModule will go through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes used by the CUs. TODO: 1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We need to add a list of variables that are used by DbgDeclareInst and DbgValueInst. 2> MDString fields should be null or isa<MDString> and MDNode fields should be null or isa<MDNode>. We currently use empty string or int 0 to represent null. 3> Go though Verify functions and make sure that they check field types. 4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each testing case has a llvm.dbg.cu. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187609 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a way to get the context of any particular scope.Eric Christopher2013-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187212 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Eric Christopher2013-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187017 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary constructors as the default conversions will handleEric Christopher2013-07-24
| | | | | | | all enumerated cases. Reformat the rest of the existing constructors to match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187015 91177308-0d34-0410-b5e6-96231b3b80d8
* More constructor cleanup.Eric Christopher2013-07-24
| | | | | | | Move to a single constructor with a default argument and avoid the check and nullification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187014 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove one more of these.Eric Christopher2013-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187011 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove more dead/weird/misleading code.Eric Christopher2013-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187010 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove more seemingly unused code.Eric Christopher2013-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187009 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused function.Eric Christopher2013-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187001 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep similar classes near each other. No functional change.Eric Christopher2013-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186998 91177308-0d34-0410-b5e6-96231b3b80d8
* 80-column.Eric Christopher2013-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186995 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Finder: use processDeclare and processValue to list debug infoManman Ren2013-07-23
| | | | | | | | | | | | MDNodes used by DbgDeclareInst and DbgValueInst. Another 16 testing cases failed and they are disabled with -disable-debug-info-verifier. A total of 34 cases are disabled with -disable-debug-info-verifier and will be corrected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186902 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Finder: add processScope to actually handle the Scope.Manman Ren2013-07-22
| | | | | | | Instead of just adding the scope to the list, we actually handle the scope. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186867 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Verifier: simplify DIxxx::VerifyManman Ren2013-07-20
| | | | | | | | | Simplify DIxxx:Verify to not call Verify on an operand. Instead, we use DebugInfoFinder to list all MDNodes that should be a DIScope and all MDNodes that should be a DIType and we will call Verify on those lists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186737 91177308-0d34-0410-b5e6-96231b3b80d8