diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-03-28 02:44:59 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-03-28 02:44:59 +0000 |
commit | 72dfb052ab74a9e642256212a50c9b805ce5c943 (patch) | |
tree | 4107669b374987d59068c6bd3c52f4864a75d8f3 /lib/IR | |
parent | d7216a28d6a07a4ea4047a14427c16b96feeb36f (diff) |
Revert "Adding DIImportedModules to DIScopes."
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178215 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r-- | lib/IR/DIBuilder.cpp | 138 | ||||
-rw-r--r-- | lib/IR/DebugInfo.cpp | 87 |
2 files changed, 62 insertions, 163 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index ee53dffed0..0d18bed001 100644 --- a/lib/IR/DIBuilder.cpp +++ b/lib/IR/DIBuilder.cpp @@ -104,7 +104,6 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_compile_unit), createFilePathPair(VMContext, Filename, Directory), - NULL, // Imported modules ConstantInt::get(Type::getInt32Ty(VMContext), Lang), MDString::get(VMContext, Producer), ConstantInt::get(Type::getInt1Ty(VMContext), isOptimized), @@ -116,9 +115,7 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename, TempGVs, MDString::get(VMContext, SplitName) }; - DICompileUnit CU(MDNode::get(VMContext, Elts)); - assert(CU.Verify() && "The compile unit should be valid"); - TheCU = CU; + TheCU = DICompileUnit(MDNode::get(VMContext, Elts)); // Create a named metadata so that it is easier to find cu in a module. NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu"); @@ -130,12 +127,9 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename, DIFile DIBuilder::createFile(StringRef Filename, StringRef Directory) { Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_file_type), - createFilePathPair(VMContext, Filename, Directory), - NULL // Imported modules + createFilePathPair(VMContext, Filename, Directory) }; - DIFile F(MDNode::get(VMContext, Elts)); - assert(F.Verify() && "The DIFile should be valid"); - return F; + return DIFile(MDNode::get(VMContext, Elts)); } /// createEnumerator - Create a single enumerator value. @@ -146,9 +140,7 @@ DIEnumerator DIBuilder::createEnumerator(StringRef Name, uint64_t Val) { MDString::get(VMContext, Name), ConstantInt::get(Type::getInt64Ty(VMContext), Val) }; - DIEnumerator E(MDNode::get(VMContext, Elts)); - assert(E.Verify() && "The enumerator should be valid"); - return E; + return DIEnumerator(MDNode::get(VMContext, Elts)); } /// createNullPtrType - Create C++0x nullptr type. @@ -159,7 +151,6 @@ DIType DIBuilder::createNullPtrType(StringRef Name) { Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_unspecified_type), NULL, // Filename - Constant::getNullValue(Type::getInt32Ty(VMContext)), // Imported modules NULL, //TheCU, MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line @@ -169,9 +160,7 @@ DIType DIBuilder::createNullPtrType(StringRef Name) { ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags; ConstantInt::get(Type::getInt32Ty(VMContext), 0) // Encoding }; - DIType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The nullptr type should be valid"); - return T; + return DIType(MDNode::get(VMContext, Elts)); } /// createBasicType - Create debugging information entry for a basic @@ -185,7 +174,6 @@ DIBuilder::createBasicType(StringRef Name, uint64_t SizeInBits, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_base_type), NULL, // File/directory name - NULL, // Imported modules NULL, //TheCU, MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line @@ -195,9 +183,7 @@ DIBuilder::createBasicType(StringRef Name, uint64_t SizeInBits, ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags; ConstantInt::get(Type::getInt32Ty(VMContext), Encoding) }; - DIBasicType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The basic type should be valid"); - return T; + return DIBasicType(MDNode::get(VMContext, Elts)); } /// createQualifiedType - Create debugging information entry for a qualified @@ -207,7 +193,6 @@ DIDerivedType DIBuilder::createQualifiedType(unsigned Tag, DIType FromTy) { Value *Elts[] = { GetTagConstant(VMContext, Tag), NULL, // Filename - NULL, // Imported modules NULL, //TheCU, MDString::get(VMContext, StringRef()), // Empty name. ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line @@ -217,9 +202,7 @@ DIDerivedType DIBuilder::createQualifiedType(unsigned Tag, DIType FromTy) { ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags FromTy }; - DIDerivedType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The derived type should be valid"); - return T; + return DIDerivedType(MDNode::get(VMContext, Elts)); } /// createPointerType - Create debugging information entry for a pointer. @@ -230,7 +213,6 @@ DIBuilder::createPointerType(DIType PointeeTy, uint64_t SizeInBits, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_pointer_type), NULL, // Filename - NULL, // Imported modules NULL, //TheCU, MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line @@ -240,9 +222,7 @@ DIBuilder::createPointerType(DIType PointeeTy, uint64_t SizeInBits, ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags PointeeTy }; - DIDerivedType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The pointer type should be valid"); - return T; + return DIDerivedType(MDNode::get(VMContext, Elts)); } DIDerivedType DIBuilder::createMemberPointerType(DIType PointeeTy, DIType Base) { @@ -250,7 +230,6 @@ DIDerivedType DIBuilder::createMemberPointerType(DIType PointeeTy, DIType Base) Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_ptr_to_member_type), NULL, // Filename - NULL, // Imported modules NULL, //TheCU, NULL, ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line @@ -261,9 +240,7 @@ DIDerivedType DIBuilder::createMemberPointerType(DIType PointeeTy, DIType Base) PointeeTy, Base }; - DIDerivedType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The member pointer type should be valid"); - return T; + return DIDerivedType(MDNode::get(VMContext, Elts)); } /// createReferenceType - Create debugging information entry for a reference @@ -274,7 +251,6 @@ DIDerivedType DIBuilder::createReferenceType(unsigned Tag, DIType RTy) { Value *Elts[] = { GetTagConstant(VMContext, Tag), NULL, // Filename - NULL, // Imported modules NULL, // TheCU, NULL, // Name ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line @@ -284,9 +260,7 @@ DIDerivedType DIBuilder::createReferenceType(unsigned Tag, DIType RTy) { ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags RTy }; - DIDerivedType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The reference type should be valid"); - return T; + return DIDerivedType(MDNode::get(VMContext, Elts)); } /// createTypedef - Create debugging information entry for a typedef. @@ -297,7 +271,6 @@ DIDerivedType DIBuilder::createTypedef(DIType Ty, StringRef Name, DIFile File, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_typedef), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Context), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), @@ -307,9 +280,7 @@ DIDerivedType DIBuilder::createTypedef(DIType Ty, StringRef Name, DIFile File, ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags Ty }; - DIDerivedType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The typedef Type should be valid"); - return T; + return DIDerivedType(MDNode::get(VMContext, Elts)); } /// createFriend - Create debugging information entry for a 'friend'. @@ -320,7 +291,6 @@ DIType DIBuilder::createFriend(DIType Ty, DIType FriendTy) { Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_friend), NULL, - NULL, // Imported modules Ty, NULL, // Name ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line @@ -330,9 +300,7 @@ DIType DIBuilder::createFriend(DIType Ty, DIType FriendTy) { ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags FriendTy }; - DIType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The friend type should be valid"); - return T; + return DIType(MDNode::get(VMContext, Elts)); } /// createInheritance - Create debugging information entry to establish @@ -344,7 +312,6 @@ DIDerivedType DIBuilder::createInheritance( Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_inheritance), NULL, - NULL, // Imported modules Ty, NULL, // Name ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line @@ -354,9 +321,7 @@ DIDerivedType DIBuilder::createInheritance( ConstantInt::get(Type::getInt32Ty(VMContext), Flags), BaseTy }; - DIDerivedType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The inheritance type should be valid"); - return T; + return DIDerivedType(MDNode::get(VMContext, Elts)); } /// createMemberType - Create debugging information entry for a member. @@ -368,7 +333,6 @@ DIDerivedType DIBuilder::createMemberType( Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_member), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Scope), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), @@ -378,9 +342,7 @@ DIDerivedType DIBuilder::createMemberType( ConstantInt::get(Type::getInt32Ty(VMContext), Flags), Ty }; - DIDerivedType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The member type should be valid"); - return T; + return DIDerivedType(MDNode::get(VMContext, Elts)); } /// createStaticMemberType - Create debugging information entry for a @@ -394,7 +356,6 @@ DIType DIBuilder::createStaticMemberType(DIDescriptor Scope, StringRef Name, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_member), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Scope), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), @@ -405,9 +366,7 @@ DIType DIBuilder::createStaticMemberType(DIDescriptor Scope, StringRef Name, Ty, Val }; - DIType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The static member type should be valid"); - return T; + return DIType(MDNode::get(VMContext, Elts)); } /// createObjCIVar - Create debugging information entry for Objective-C @@ -423,7 +382,6 @@ DIType DIBuilder::createObjCIVar(StringRef Name, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_member), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(File), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), @@ -437,9 +395,7 @@ DIType DIBuilder::createObjCIVar(StringRef Name, MDString::get(VMContext, SetterName), ConstantInt::get(Type::getInt32Ty(VMContext), PropertyAttributes) }; - DIType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The Objective-C IVar type should be valid"); - return T; + return DIType(MDNode::get(VMContext, Elts)); } /// createObjCIVar - Create debugging information entry for Objective-C @@ -453,7 +409,6 @@ DIType DIBuilder::createObjCIVar(StringRef Name, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_member), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(File), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), @@ -464,9 +419,7 @@ DIType DIBuilder::createObjCIVar(StringRef Name, Ty, PropertyNode }; - DIType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The Objective-C IVar type should be valid"); - return T; + return DIType(MDNode::get(VMContext, Elts)); } /// createObjCProperty - Create debugging information entry for Objective-C @@ -487,9 +440,7 @@ DIObjCProperty DIBuilder::createObjCProperty(StringRef Name, ConstantInt::get(Type::getInt32Ty(VMContext), PropertyAttributes), Ty }; - DIObjCProperty P(MDNode::get(VMContext, Elts)); - assert(P.Verify() && "The Objective-C property should be valid"); - return P; + return DIObjCProperty(MDNode::get(VMContext, Elts)); } /// createTemplateTypeParameter - Create debugging information for template @@ -507,9 +458,7 @@ DIBuilder::createTemplateTypeParameter(DIDescriptor Context, StringRef Name, ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), ConstantInt::get(Type::getInt32Ty(VMContext), ColumnNo) }; - DITemplateTypeParameter P(MDNode::get(VMContext, Elts)); - assert(P.Verify() && "The template type parameter should be valid"); - return P; + return DITemplateTypeParameter(MDNode::get(VMContext, Elts)); } /// createTemplateValueParameter - Create debugging information for template @@ -529,9 +478,7 @@ DIBuilder::createTemplateValueParameter(DIDescriptor Context, StringRef Name, ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), ConstantInt::get(Type::getInt32Ty(VMContext), ColumnNo) }; - DITemplateValueParameter P(MDNode::get(VMContext, Elts)); - assert(P.Verify() && "The template value parameter should be valid"); - return P; + return DITemplateValueParameter(MDNode::get(VMContext, Elts)); } /// createClassType - Create debugging information entry for a class. @@ -550,7 +497,6 @@ DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_class_type), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Context), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), @@ -583,7 +529,6 @@ DICompositeType DIBuilder::createStructType(DIDescriptor Context, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_structure_type), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Context), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), @@ -611,7 +556,6 @@ DICompositeType DIBuilder::createUnionType( Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_union_type), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Scope), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), @@ -624,9 +568,7 @@ DICompositeType DIBuilder::createUnionType( ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang), Constant::getNullValue(Type::getInt32Ty(VMContext)) }; - DICompositeType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The union type should be valid"); - return T; + return DICompositeType(MDNode::get(VMContext, Elts)); } /// createSubroutineType - Create subroutine type. @@ -636,7 +578,6 @@ DIBuilder::createSubroutineType(DIFile File, DIArray ParameterTypes) { Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_subroutine_type), Constant::getNullValue(Type::getInt32Ty(VMContext)), - Constant::getNullValue(Type::getInt32Ty(VMContext)), // Imported modules Constant::getNullValue(Type::getInt32Ty(VMContext)), MDString::get(VMContext, ""), ConstantInt::get(Type::getInt32Ty(VMContext), 0), @@ -649,9 +590,7 @@ DIBuilder::createSubroutineType(DIFile File, DIArray ParameterTypes) { ConstantInt::get(Type::getInt32Ty(VMContext), 0), Constant::getNullValue(Type::getInt32Ty(VMContext)) }; - DICompositeType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The subroutine type should be valid"); - return T; + return DICompositeType(MDNode::get(VMContext, Elts)); } /// createEnumerationType - Create debugging information entry for an @@ -664,7 +603,6 @@ DICompositeType DIBuilder::createEnumerationType( Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_enumeration_type), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Scope), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), @@ -679,9 +617,7 @@ DICompositeType DIBuilder::createEnumerationType( }; MDNode *Node = MDNode::get(VMContext, Elts); AllEnumTypes.push_back(Node); - DICompositeType T(Node); - assert(T.Verify() && "The enumeration type should be valid"); - return T; + return DICompositeType(Node); } /// createArrayType - Create debugging information entry for an array. @@ -691,7 +627,6 @@ DICompositeType DIBuilder::createArrayType(uint64_t Size, uint64_t AlignInBits, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_array_type), NULL, // Filename/Directory, - Constant::getNullValue(Type::getInt32Ty(VMContext)), // Imported modules NULL, //TheCU, MDString::get(VMContext, ""), ConstantInt::get(Type::getInt32Ty(VMContext), 0), @@ -704,9 +639,7 @@ DICompositeType DIBuilder::createArrayType(uint64_t Size, uint64_t AlignInBits, ConstantInt::get(Type::getInt32Ty(VMContext), 0), Constant::getNullValue(Type::getInt32Ty(VMContext)) }; - DICompositeType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The array type should be valid"); - return T; + return DICompositeType(MDNode::get(VMContext, Elts)); } /// createVectorType - Create debugging information entry for a vector. @@ -717,7 +650,6 @@ DIType DIBuilder::createVectorType(uint64_t Size, uint64_t AlignInBits, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_array_type), NULL, // Filename/Directory, - Constant::getNullValue(Type::getInt32Ty(VMContext)), // Imported modules NULL, //TheCU, MDString::get(VMContext, ""), ConstantInt::get(Type::getInt32Ty(VMContext), 0), @@ -730,9 +662,7 @@ DIType DIBuilder::createVectorType(uint64_t Size, uint64_t AlignInBits, ConstantInt::get(Type::getInt32Ty(VMContext), 0), Constant::getNullValue(Type::getInt32Ty(VMContext)) }; - DIType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The vector type should be valid"); - return T; + return DIType(MDNode::get(VMContext, Elts)); } /// createArtificialType - Create a new DIType with "artificial" flag set. @@ -754,11 +684,9 @@ DIType DIBuilder::createArtificialType(DIType Ty) { CurFlags = CurFlags | DIType::FlagArtificial; // Flags are stored at this slot. - Elts[9] = ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags); + Elts[8] = ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags); - DIType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The artificial type should be valid"); - return T; + return DIType(MDNode::get(VMContext, Elts)); } /// createObjectPointerType - Create a new type with both the object pointer @@ -781,11 +709,9 @@ DIType DIBuilder::createObjectPointerType(DIType Ty) { CurFlags = CurFlags | (DIType::FlagObjectPointer | DIType::FlagArtificial); // Flags are stored at this slot. - Elts[9] = ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags); + Elts[8] = ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags); - DIType T(MDNode::get(VMContext, Elts)); - assert(T.Verify() && "The object pointer type should be valid"); - return T; + return DIType(MDNode::get(VMContext, Elts)); } /// retainType - Retain DIType in a module even if it is not referenced @@ -814,7 +740,6 @@ DIType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name, Value *Elts[] = { GetTagConstant(VMContext, Tag), F.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Scope), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), Line), @@ -986,7 +911,6 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_subprogram), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Context), MDString::get(VMContext, Name), MDString::get(VMContext, Name), @@ -1034,7 +958,6 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_subprogram), F.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Context), MDString::get(VMContext, Name), MDString::get(VMContext, Name), @@ -1070,7 +993,6 @@ DINameSpace DIBuilder::createNameSpace(DIDescriptor Scope, StringRef Name, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_namespace), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Scope), MDString::get(VMContext, Name), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo) @@ -1088,7 +1010,6 @@ DILexicalBlockFile DIBuilder::createLexicalBlockFile(DIDescriptor Scope, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_lexical_block), File.getFileNode(), - NULL, // Imported modules Scope }; DILexicalBlockFile R(MDNode::get(VMContext, Elts)); @@ -1105,7 +1026,6 @@ DILexicalBlock DIBuilder::createLexicalBlock(DIDescriptor Scope, DIFile File, Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_lexical_block), File.getFileNode(), - NULL, // Imported modules getNonCompileUnitScope(Scope), ConstantInt::get(Type::getInt32Ty(VMContext), Line), ConstantInt::get(Type::getInt32Ty(VMContext), Col), diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index a1d18e1f93..0ffe99d704 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -64,8 +64,7 @@ bool DIDescriptor::Verify() const { DISubrange(DbgNode).Verify() || DIEnumerator(DbgNode).Verify() || DIObjCProperty(DbgNode).Verify() || DITemplateTypeParameter(DbgNode).Verify() || - DITemplateValueParameter(DbgNode).Verify() || - DIImportedModule(DbgNode).Verify()); + DITemplateValueParameter(DbgNode).Verify()); } static Value *getField(const MDNode *DbgNode, unsigned Elt) { @@ -314,13 +313,13 @@ bool DIDescriptor::isNameSpace() const { /// lexical block with an extra file. bool DIDescriptor::isLexicalBlockFile() const { return DbgNode && getTag() == dwarf::DW_TAG_lexical_block && - (DbgNode->getNumOperands() == 4); + (DbgNode->getNumOperands() == 3); } /// isLexicalBlock - Return true if the specified tag is DW_TAG_lexical_block. bool DIDescriptor::isLexicalBlock() const { return DbgNode && getTag() == dwarf::DW_TAG_lexical_block && - (DbgNode->getNumOperands() > 4); + (DbgNode->getNumOperands() > 3); } /// isSubrange - Return true if the specified tag is DW_TAG_subrange_type. @@ -337,12 +336,6 @@ bool DIDescriptor::isEnumerator() const { bool DIDescriptor::isObjCProperty() const { return DbgNode && getTag() == dwarf::DW_TAG_APPLE_property; } - -/// \brief Return true if the specified tag is DW_TAG_imported_module. -bool DIDescriptor::isImportedModule() const { - return DbgNode && getTag() == dwarf::DW_TAG_imported_module; -} - //===----------------------------------------------------------------------===// // Simple Descriptor Constructors and other Methods //===----------------------------------------------------------------------===// @@ -425,7 +418,7 @@ bool DICompileUnit::Verify() const { if (N.empty()) return false; // It is possible that directory and produce string is empty. - return DbgNode->getNumOperands() == 13; + return DbgNode->getNumOperands() == 12; } /// Verify - Verify that an ObjC property is well formed. @@ -456,7 +449,6 @@ bool DIType::Verify() const { Tag != dwarf::DW_TAG_array_type && Tag != dwarf::DW_TAG_enumeration_type && Tag != dwarf::DW_TAG_subroutine_type && - Tag != dwarf::DW_TAG_friend && getFilename().empty()) return false; return true; @@ -464,13 +456,13 @@ bool DIType::Verify() const { /// Verify - Verify that a basic type descriptor is well formed. bool DIBasicType::Verify() const { - return isBasicType() && DbgNode->getNumOperands() == 11; + return isBasicType() && DbgNode->getNumOperands() == 10; } /// Verify - Verify that a derived type descriptor is well formed. bool DIDerivedType::Verify() const { - return isDerivedType() && DbgNode->getNumOperands() >= 11 && - DbgNode->getNumOperands() <= 15; + return isDerivedType() && DbgNode->getNumOperands() >= 10 && + DbgNode->getNumOperands() <= 14; } /// Verify - Verify that a composite type descriptor is well formed. @@ -480,7 +472,7 @@ bool DICompositeType::Verify() const { if (getContext() && !getContext().Verify()) return false; - return DbgNode->getNumOperands() >= 11 && DbgNode->getNumOperands() <= 15; + return DbgNode->getNumOperands() >= 10 && DbgNode->getNumOperands() <= 14; } /// Verify - Verify that a subprogram descriptor is well formed. @@ -494,7 +486,7 @@ bool DISubprogram::Verify() const { DICompositeType Ty = getType(); if (!Ty.Verify()) return false; - return DbgNode->getNumOperands() == 21; + return DbgNode->getNumOperands() == 20; } /// Verify - Verify that a global variable descriptor is well formed. @@ -545,7 +537,7 @@ bool DILocation::Verify() const { bool DINameSpace::Verify() const { if (!isNameSpace()) return false; - return DbgNode->getNumOperands() == 6; + return DbgNode->getNumOperands() == 5; } /// \brief Retrieve the MDNode for the directory/file pair. @@ -555,7 +547,7 @@ MDNode *DIFile::getFileNode() const { /// \brief Verify that the file descriptor is well formed. bool DIFile::Verify() const { - return isFile() && DbgNode->getNumOperands() == 3; + return isFile() && DbgNode->getNumOperands() == 2; } /// \brief Verify that the enumerator descriptor is well formed. @@ -570,12 +562,12 @@ bool DISubrange::Verify() const { /// \brief Verify that the lexical block descriptor is well formed. bool DILexicalBlock::Verify() const { - return isLexicalBlock() && DbgNode->getNumOperands() == 7; + return isLexicalBlock() && DbgNode->getNumOperands() == 6; } /// \brief Verify that the file-scoped lexical block descriptor is well formed. bool DILexicalBlockFile::Verify() const { - return isLexicalBlockFile() && DbgNode->getNumOperands() == 4; + return isLexicalBlockFile() && DbgNode->getNumOperands() == 3; } /// \brief Verify that the template type parameter descriptor is well formed. @@ -588,11 +580,6 @@ bool DITemplateValueParameter::Verify() const { return isTemplateValueParameter() && DbgNode->getNumOperands() == 8; } -/// \brief Verify that the imported module descriptor is well formed. -bool DIImportedModule::Verify() const { - return isImportedModule() && DbgNode->getNumOperands() == 2; -} - /// getOriginalTypeSize - If this type is derived from a base type then /// return base type size. uint64_t DIDerivedType::getOriginalTypeSize() const { @@ -624,27 +611,27 @@ uint64_t DIDerivedType::getOriginalTypeSize() const { /// getObjCProperty - Return property node, if this ivar is associated with one. MDNode *DIDerivedType::getObjCProperty() const { - if (DbgNode->getNumOperands() <= 11) + if (DbgNode->getNumOperands() <= 10) return NULL; - return dyn_cast_or_null<MDNode>(DbgNode->getOperand(11)); + return dyn_cast_or_null<MDNode>(DbgNode->getOperand(10)); } /// \brief Set the array of member DITypes. void DICompositeType::setTypeArray(DIArray Elements, DIArray TParams) { - assert((!TParams || DbgNode->getNumOperands() == 15) && + assert((!TParams || DbgNode->getNumOperands() == 14) && "If you're setting the template parameters this should include a slot " "for that!"); TrackingVH<MDNode> N(*this); - N->replaceOperandWith(11, Elements); + N->replaceOperandWith(10, Elements); if (TParams) - N->replaceOperandWith(14, TParams); + N->replaceOperandWith(13, TParams); DbgNode = N; } /// \brief Set the containing type. void DICompositeType::setContainingType(DICompositeType ContainingType) { TrackingVH<MDNode> N(*this); - N->replaceOperandWith(13, ContainingType); + N->replaceOperandWith(12, ContainingType); DbgNode = N; } @@ -675,21 +662,21 @@ bool DISubprogram::describes(const Function *F) { unsigned DISubprogram::isOptimized() const { assert (DbgNode && "Invalid subprogram descriptor!"); - if (DbgNode->getNumOperands() == 16) - return getUnsignedField(15); + if (DbgNode->getNumOperands() == 15) + return getUnsignedField(14); return 0; } MDNode *DISubprogram::getVariablesNodes() const { - if (!DbgNode || DbgNode->getNumOperands() <= 19) + if (!DbgNode || DbgNode->getNumOperands() <= 18) return NULL; - return dyn_cast_or_null<MDNode>(DbgNode->getOperand(19)); + return dyn_cast_or_null<MDNode>(DbgNode->getOperand(18)); } DIArray DISubprogram::getVariables() const { - if (!DbgNode || DbgNode->getNumOperands() <= 19) + if (!DbgNode || DbgNode->getNumOperands() <= 18) return DIArray(); - if (MDNode *T = dyn_cast_or_null<MDNode>(DbgNode->getOperand(19))) + if (MDNode *T = dyn_cast_or_null<MDNode>(DbgNode->getOperand(18))) return DIArray(T); return DIArray(); } @@ -707,38 +694,38 @@ StringRef DIScope::getDirectory() const { } DIArray DICompileUnit::getEnumTypes() const { - if (!DbgNode || DbgNode->getNumOperands() < 13) + if (!DbgNode || DbgNode->getNumOperands() < 12) return DIArray(); - if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(8))) + if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(7))) return DIArray(N); return DIArray(); } DIArray DICompileUnit::getRetainedTypes() const { - if (!DbgNode || DbgNode->getNumOperands() < 13) + if (!DbgNode || DbgNode->getNumOperands() < 12) return DIArray(); - if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(9))) + if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(8))) return DIArray(N); return DIArray(); } DIArray DICompileUnit::getSubprograms() const { - if (!DbgNode || DbgNode->getNumOperands() < 13) + if (!DbgNode || DbgNode->getNumOperands() < 12) return DIArray(); - if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(10))) + if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(9))) return DIArray(N); return DIArray(); } DIArray DICompileUnit::getGlobalVariables() const { - if (!DbgNode || DbgNode->getNumOperands() < 13) + if (!DbgNode || DbgNode->getNumOperands() < 12) return DIArray(); - if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(11))) + if (MDNode *N = dyn_cast_or_null<MDNode>(DbgNode->getOperand(10))) return DIArray(N); return DIArray(); } @@ -1050,8 +1037,6 @@ void DIDescriptor::print(raw_ostream &OS) const { DINameSpace(DbgNode).printInternal(OS); } else if (this->isScope()) { DIScope(DbgNode).printInternal(OS); - } else if (this->isImportedModule()) { - DIImportedModule(DbgNode).printInternal(OS); } } @@ -1187,12 +1172,6 @@ void DIObjCProperty::printInternal(raw_ostream &OS) const { << ", properties " << getUnsignedField(6) << ']'; } -void DIImportedModule::printInternal(raw_ostream &OS) const { - StringRef Name = getNameSpace().getName(); - if (!Name.empty()) - OS << " [" << Name << ']'; -} - static void printDebugLoc(DebugLoc DL, raw_ostream &CommentOS, const LLVMContext &Ctx) { if (!DL.isUnknown()) { // Print source line info. |