diff options
author | Devang Patel <dpatel@apple.com> | 2010-03-09 00:44:10 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-03-09 00:44:10 +0000 |
commit | 4b945500a5eb1b32ee8004e40e386105ee5815eb (patch) | |
tree | d80c653fecbdb5081b473c628acb05af4bf2b07d /lib/Analysis/DebugInfo.cpp | |
parent | cf6f28d84af09b38e96307007cd93760a7ca42d7 (diff) |
Start using DIFile. See updated SourceLevelDebugging.html for more information.
This patch updates LLVMDebugVersion to 8.
Debug info descriptors encoded using LLVMDebugVersion 7 is supported.
Corresponding llvmgcc and clang FE commits are required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 49b2e6b2c5..fda69ac39a 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -41,9 +41,9 @@ bool DIDescriptor::ValidDebugInfo(MDNode *N, unsigned OptLevel) { DIDescriptor DI(N); - // Check current version. Allow Version6 for now. + // Check current version. Allow Version7 for now. unsigned Version = DI.getVersion(); - if (Version != LLVMDebugVersion && Version != LLVMDebugVersion6) + if (Version != LLVMDebugVersion && Version != LLVMDebugVersion7) return false; switch (DI.getTag()) { @@ -698,7 +698,7 @@ DIEnumerator DIFactory::CreateEnumerator(StringRef Name, uint64_t Val){ /// CreateBasicType - Create a basic type like int, float, etc. DIBasicType DIFactory::CreateBasicType(DIDescriptor Context, StringRef Name, - DICompileUnit CompileUnit, + DIFile F, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, @@ -708,7 +708,7 @@ DIBasicType DIFactory::CreateBasicType(DIDescriptor Context, GetTagConstant(dwarf::DW_TAG_base_type), Context.getNode(), MDString::get(VMContext, Name), - CompileUnit.getNode(), + F.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), @@ -723,7 +723,7 @@ DIBasicType DIFactory::CreateBasicType(DIDescriptor Context, /// CreateBasicType - Create a basic type like int, float, etc. DIBasicType DIFactory::CreateBasicTypeEx(DIDescriptor Context, StringRef Name, - DICompileUnit CompileUnit, + DIFile F, unsigned LineNumber, Constant *SizeInBits, Constant *AlignInBits, @@ -733,7 +733,7 @@ DIBasicType DIFactory::CreateBasicTypeEx(DIDescriptor Context, GetTagConstant(dwarf::DW_TAG_base_type), Context.getNode(), MDString::get(VMContext, Name), - CompileUnit.getNode(), + F.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), SizeInBits, AlignInBits, @@ -773,7 +773,7 @@ DIType DIFactory::CreateArtificialType(DIType Ty) { DIDerivedType DIFactory::CreateDerivedType(unsigned Tag, DIDescriptor Context, StringRef Name, - DICompileUnit CompileUnit, + DIFile F, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, @@ -784,7 +784,7 @@ DIDerivedType DIFactory::CreateDerivedType(unsigned Tag, GetTagConstant(Tag), Context.getNode(), MDString::get(VMContext, Name), - CompileUnit.getNode(), + F.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), @@ -801,7 +801,7 @@ DIDerivedType DIFactory::CreateDerivedType(unsigned Tag, DIDerivedType DIFactory::CreateDerivedTypeEx(unsigned Tag, DIDescriptor Context, StringRef Name, - DICompileUnit CompileUnit, + DIFile F, unsigned LineNumber, Constant *SizeInBits, Constant *AlignInBits, @@ -812,7 +812,7 @@ DIDerivedType DIFactory::CreateDerivedTypeEx(unsigned Tag, GetTagConstant(Tag), Context.getNode(), MDString::get(VMContext, Name), - CompileUnit.getNode(), + F.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), SizeInBits, AlignInBits, @@ -828,7 +828,7 @@ DIDerivedType DIFactory::CreateDerivedTypeEx(unsigned Tag, DICompositeType DIFactory::CreateCompositeType(unsigned Tag, DIDescriptor Context, StringRef Name, - DICompileUnit CompileUnit, + DIFile F, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, @@ -843,7 +843,7 @@ DICompositeType DIFactory::CreateCompositeType(unsigned Tag, GetTagConstant(Tag), Context.getNode(), MDString::get(VMContext, Name), - CompileUnit.getNode(), + F.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits), ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits), @@ -862,7 +862,7 @@ DICompositeType DIFactory::CreateCompositeType(unsigned Tag, DICompositeType DIFactory::CreateCompositeTypeEx(unsigned Tag, DIDescriptor Context, StringRef Name, - DICompileUnit CompileUnit, + DIFile F, unsigned LineNumber, Constant *SizeInBits, Constant *AlignInBits, @@ -876,7 +876,7 @@ DICompositeType DIFactory::CreateCompositeTypeEx(unsigned Tag, GetTagConstant(Tag), Context.getNode(), MDString::get(VMContext, Name), - CompileUnit.getNode(), + F.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber), SizeInBits, AlignInBits, @@ -897,7 +897,7 @@ DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context, StringRef Name, StringRef DisplayName, StringRef LinkageName, - DICompileUnit CompileUnit, + DIFile F, unsigned LineNo, DIType Ty, bool isLocalToUnit, bool isDefinition, @@ -912,7 +912,7 @@ DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context, MDString::get(VMContext, Name), MDString::get(VMContext, DisplayName), MDString::get(VMContext, LinkageName), - CompileUnit.getNode(), + F.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), Ty.getNode(), ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit), @@ -957,7 +957,7 @@ DIGlobalVariable DIFactory::CreateGlobalVariable(DIDescriptor Context, StringRef Name, StringRef DisplayName, StringRef LinkageName, - DICompileUnit CompileUnit, + DIFile F, unsigned LineNo, DIType Ty,bool isLocalToUnit, bool isDefinition, llvm::GlobalVariable *Val) { Value *Elts[] = { @@ -967,7 +967,7 @@ DIFactory::CreateGlobalVariable(DIDescriptor Context, StringRef Name, MDString::get(VMContext, Name), MDString::get(VMContext, DisplayName), MDString::get(VMContext, LinkageName), - CompileUnit.getNode(), + F.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), Ty.getNode(), ConstantInt::get(Type::getInt1Ty(VMContext), isLocalToUnit), @@ -989,13 +989,14 @@ DIFactory::CreateGlobalVariable(DIDescriptor Context, StringRef Name, /// CreateVariable - Create a new descriptor for the specified variable. DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context, StringRef Name, - DICompileUnit CompileUnit, unsigned LineNo, + DIFile F, + unsigned LineNo, DIType Ty) { Value *Elts[] = { GetTagConstant(Tag), Context.getNode(), MDString::get(VMContext, Name), - CompileUnit.getNode(), + F.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), Ty.getNode(), }; @@ -1007,7 +1008,7 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context, /// which has a complex address expression for its address. DIVariable DIFactory::CreateComplexVariable(unsigned Tag, DIDescriptor Context, const std::string &Name, - DICompileUnit CompileUnit, + DIFile F, unsigned LineNo, DIType Ty, SmallVector<Value *, 9> &addr) { @@ -1015,7 +1016,7 @@ DIVariable DIFactory::CreateComplexVariable(unsigned Tag, DIDescriptor Context, Elts.push_back(GetTagConstant(Tag)); Elts.push_back(Context.getNode()); Elts.push_back(MDString::get(VMContext, Name)); - Elts.push_back(CompileUnit.getNode()); + Elts.push_back(F.getNode()); Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext), LineNo)); Elts.push_back(Ty.getNode()); Elts.insert(Elts.end(), addr.begin(), addr.end()); @@ -1040,13 +1041,13 @@ DILexicalBlock DIFactory::CreateLexicalBlock(DIDescriptor Context, /// CreateNameSpace - This creates new descriptor for a namespace /// with the specified parent context. DINameSpace DIFactory::CreateNameSpace(DIDescriptor Context, StringRef Name, - DICompileUnit CompileUnit, + DIFile F, unsigned LineNo) { Value *Elts[] = { GetTagConstant(dwarf::DW_TAG_namespace), Context.getNode(), MDString::get(VMContext, Name), - CompileUnit.getNode(), + F.getNode(), ConstantInt::get(Type::getInt32Ty(VMContext), LineNo) }; return DINameSpace(MDNode::get(VMContext, &Elts[0], 5)); |