aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-16 01:37:00 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-16 01:37:00 +0000
commitb273d06b63316d03379125d2803b798cfe7c90e6 (patch)
tree96f4aaeceabc9791b59399a923ad8a319368e9de /llvm/lib/IR/DIBuilder.cpp
parent373ee859661b0843fc874dbf24b3e600e64e0b43 (diff)
downloadllvm-b273d06b63316d03379125d2803b798cfe7c90e6.zip
llvm-b273d06b63316d03379125d2803b798cfe7c90e6.tar.gz
llvm-b273d06b63316d03379125d2803b798cfe7c90e6.tar.bz2
DebugInfo: Gut DIScope, DIEnumerator and DISubrange
The only class the still has API left is `DIDescriptor` itself. llvm-svn: 235067
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 067a7ee..893f9f2 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -348,8 +348,7 @@ DIBuilder::createObjCProperty(StringRef Name, DIFile File, unsigned LineNumber,
DITemplateTypeParameter
DIBuilder::createTemplateTypeParameter(DIDescriptor Context, StringRef Name,
DIType Ty) {
- assert((!Context || isa<MDCompileUnit>(Context.get())) &&
- "Expected compile unit");
+ assert((!Context || isa<MDCompileUnit>(Context)) && "Expected compile unit");
return MDTemplateTypeParameter::get(VMContext, Name, MDTypeRef::get(Ty));
}
@@ -357,8 +356,7 @@ static DITemplateValueParameter
createTemplateValueParameterHelper(LLVMContext &VMContext, unsigned Tag,
DIDescriptor Context, StringRef Name,
DIType Ty, Metadata *MD) {
- assert((!Context || isa<MDCompileUnit>(Context.get())) &&
- "Expected compile unit");
+ assert((!Context || isa<MDCompileUnit>(Context)) && "Expected compile unit");
return MDTemplateValueParameter::get(VMContext, Tag, Name, MDTypeRef::get(Ty),
MD);
}
@@ -590,10 +588,10 @@ DIGlobalVariable DIBuilder::createGlobalVariable(
MDNode *Decl) {
checkGlobalVariableScope(Context);
- auto *N = MDGlobalVariable::get(
- VMContext, cast_or_null<MDScope>(Context.get()), Name, LinkageName, F,
- LineNumber, MDTypeRef::get(Ty), isLocalToUnit, true, Val,
- cast_or_null<MDDerivedType>(Decl));
+ auto *N = MDGlobalVariable::get(VMContext, cast_or_null<MDScope>(Context),
+ Name, LinkageName, F, LineNumber,
+ MDTypeRef::get(Ty), isLocalToUnit, true, Val,
+ cast_or_null<MDDerivedType>(Decl));
AllGVs.push_back(N);
return N;
}
@@ -605,9 +603,10 @@ DIGlobalVariable DIBuilder::createTempGlobalVariableFwdDecl(
checkGlobalVariableScope(Context);
return MDGlobalVariable::getTemporary(
- VMContext, cast_or_null<MDScope>(Context.get()), Name, LinkageName,
- F, LineNumber, MDTypeRef::get(Ty), isLocalToUnit, false, Val,
- cast_or_null<MDDerivedType>(Decl)).release();
+ VMContext, cast_or_null<MDScope>(Context), Name, LinkageName, F,
+ LineNumber, MDTypeRef::get(Ty), isLocalToUnit, false, Val,
+ cast_or_null<MDDerivedType>(Decl))
+ .release();
}
DIVariable DIBuilder::createLocalVariable(unsigned Tag, DIDescriptor Scope,
@@ -622,8 +621,8 @@ DIVariable DIBuilder::createLocalVariable(unsigned Tag, DIDescriptor Scope,
DIScope Context = getNonCompileUnitScope(Scope);
auto *Node = MDLocalVariable::get(
- VMContext, Tag, cast_or_null<MDLocalScope>(Context.get()), Name, File,
- LineNo, MDTypeRef::get(Ty), ArgNo, Flags);
+ VMContext, Tag, cast_or_null<MDLocalScope>(Context), Name, File, LineNo,
+ MDTypeRef::get(Ty), ArgNo, Flags);
if (AlwaysPreserve) {
// The optimizer may remove local variable. If there is an interest
// to preserve variable info in such situation then stash it in a