diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-02-04 05:56:36 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-02-04 05:56:36 +0000 |
commit | f839eed5ea2bfd395256d60e15d1e31dbad6ca8b (patch) | |
tree | 090707969a4ffd27d8fd96a8b90fc59895c53f31 /lib/IR | |
parent | a9b1317443990533f56a8420c0fbfb8868dad566 (diff) | |
download | external_llvm-f839eed5ea2bfd395256d60e15d1e31dbad6ca8b.zip external_llvm-f839eed5ea2bfd395256d60e15d1e31dbad6ca8b.tar.gz external_llvm-f839eed5ea2bfd395256d60e15d1e31dbad6ca8b.tar.bz2 |
[DebugInfo] remove more node indirection (this time from the subprogram's variable lists)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174305 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r-- | lib/IR/DIBuilder.cpp | 12 | ||||
-rw-r--r-- | lib/IR/DebugInfo.cpp | 7 |
2 files changed, 4 insertions, 15 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index 40655ec..cc397cd 100644 --- a/lib/IR/DIBuilder.cpp +++ b/lib/IR/DIBuilder.cpp @@ -900,10 +900,6 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context, MDNode *TParams, MDNode *Decl) { Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) }; - MDNode *Temp = MDNode::getTemporary(VMContext, TElts); - Value *TVElts[] = { Temp }; - MDNode *THolder = MDNode::get(VMContext, TVElts); - Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_subprogram), Constant::getNullValue(Type::getInt32Ty(VMContext)), @@ -924,7 +920,7 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context, Fn, TParams, Decl, - THolder, + MDNode::getTemporary(VMContext, TElts), ConstantInt::get(Type::getInt32Ty(VMContext), ScopeLine) }; MDNode *Node = MDNode::get(VMContext, Elts); @@ -949,10 +945,6 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context, Function *Fn, MDNode *TParam) { Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) }; - MDNode *Temp = MDNode::getTemporary(VMContext, TElts); - Value *TVElts[] = { Temp }; - MDNode *THolder = MDNode::get(VMContext, TVElts); - Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_subprogram), Constant::getNullValue(Type::getInt32Ty(VMContext)), @@ -973,7 +965,7 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context, Fn, TParam, Constant::getNullValue(Type::getInt32Ty(VMContext)), - THolder, + MDNode::getTemporary(VMContext, TElts), // FIXME: Do we want to use different scope/lines? ConstantInt::get(Type::getInt32Ty(VMContext), LineNo) }; diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index ecaab1f..a59fdcd 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -593,17 +593,14 @@ unsigned DISubprogram::isOptimized() const { MDNode *DISubprogram::getVariablesNodes() const { if (!DbgNode || DbgNode->getNumOperands() <= 19) return NULL; - if (MDNode *Temp = dyn_cast_or_null<MDNode>(DbgNode->getOperand(19))) - return dyn_cast_or_null<MDNode>(Temp->getOperand(0)); - return NULL; + return dyn_cast_or_null<MDNode>(DbgNode->getOperand(19)); } DIArray DISubprogram::getVariables() const { if (!DbgNode || DbgNode->getNumOperands() <= 19) return DIArray(); if (MDNode *T = dyn_cast_or_null<MDNode>(DbgNode->getOperand(19))) - if (MDNode *A = dyn_cast_or_null<MDNode>(T->getOperand(0))) - return DIArray(A); + return DIArray(T); return DIArray(); } |