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 | |
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
-rw-r--r-- | lib/IR/DIBuilder.cpp | 12 | ||||
-rw-r--r-- | lib/IR/DebugInfo.cpp | 7 | ||||
-rw-r--r-- | test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll | 3 | ||||
-rw-r--r-- | test/DebugInfo/X86/concrete_out_of_line.ll | 15 |
4 files changed, 10 insertions, 27 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(); } diff --git a/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll b/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll index 2557c9c..c1a88e1 100644 --- a/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll +++ b/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll @@ -49,6 +49,5 @@ entry: !21 = metadata !{i32 9, i32 0, metadata !11, metadata !17} !22 = metadata !{i32 11, i32 0, metadata !11, metadata !17} !23 = metadata !{i32 16, i32 0, metadata !18, null} -!24 = metadata !{metadata !25} -!25 = metadata !{metadata !9, metadata !10} +!24 = metadata !{metadata !9, metadata !10} diff --git a/test/DebugInfo/X86/concrete_out_of_line.ll b/test/DebugInfo/X86/concrete_out_of_line.ll index 19bb152..ef83a51 100644 --- a/test/DebugInfo/X86/concrete_out_of_line.ll +++ b/test/DebugInfo/X86/concrete_out_of_line.ll @@ -50,18 +50,14 @@ declare void @_Z8moz_freePv(i8*) !15 = metadata !{i32 720942, i32 0, metadata !13, metadata !"~nsAutoRefCnt", metadata !"~nsAutoRefCnt", metadata !"", metadata !6, i32 12, metadata !16, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 true, null, null, i32 0, metadata !18} ; [ DW_TAG_subprogram ] !16 = metadata !{i32 720917, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !17, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] !17 = metadata !{null, metadata !10} -!18 = metadata !{metadata !19} -!19 = metadata !{i32 720932} ; [ DW_TAG_base_type ] -!20 = metadata !{metadata !21} -!21 = metadata !{metadata !22} +!18 = metadata !{i32 720932} ; [ DW_TAG_base_type ] +!20 = metadata !{metadata !22} !22 = metadata !{i32 721153, metadata !5, metadata !"this", metadata !6, i32 16777230, metadata !10, i32 64, i32 0} ; [ DW_TAG_arg_variable ] !23 = metadata !{i32 720942, i32 0, null, metadata !"~nsAutoRefCnt", metadata !"~nsAutoRefCnt", metadata !"_ZN17nsAutoRefCntD1Ev", metadata !6, i32 18, metadata !16, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 true, i32* null, null, metadata !15, metadata !24} ; [ DW_TAG_subprogram ] -!24 = metadata !{metadata !25} -!25 = metadata !{metadata !26} +!24 = metadata !{metadata !26} !26 = metadata !{i32 721153, metadata !23, metadata !"this", metadata !6, i32 16777234, metadata !10, i32 64, i32 0} ; [ DW_TAG_arg_variable ] !27 = metadata !{i32 720942, i32 0, null, metadata !"~nsAutoRefCnt", metadata !"~nsAutoRefCnt", metadata !"_ZN17nsAutoRefCntD2Ev", metadata !6, i32 18, metadata !16, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 true, i32* null, null, metadata !15, metadata !28} ; [ DW_TAG_subprogram ] -!28 = metadata !{metadata !29} -!29 = metadata !{metadata !30} +!28 = metadata !{metadata !30} !30 = metadata !{i32 721153, metadata !27, metadata !"this", metadata !6, i32 16777234, metadata !10, i32 64, i32 0} ; [ DW_TAG_arg_variable ] !31 = metadata !{i32 720942, i32 0, null, metadata !"operator=", metadata !"operator=", metadata !"_ZN12nsAutoRefCntaSEi", metadata !6, i32 4, metadata !32, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 true, null, null, metadata !36, metadata !43} ; [ DW_TAG_subprogram ] !32 = metadata !{i32 720917, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !33, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] @@ -75,8 +71,7 @@ declare void @_Z8moz_freePv(i8*) !40 = metadata !{i32 720942, i32 0, metadata !37, metadata !"nsAutoRefCnt", metadata !"nsAutoRefCnt", metadata !"", metadata !6, i32 3, metadata !41, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 true, null, null, i32 0, metadata !18} ; [ DW_TAG_subprogram ] !41 = metadata !{i32 720917, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !42, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] !42 = metadata !{null, metadata !34} -!43 = metadata !{metadata !44} -!44 = metadata !{metadata !45, metadata !46} +!43 = metadata !{metadata !45, metadata !46} !45 = metadata !{i32 721153, metadata !31, metadata !"this", metadata !6, i32 16777220, metadata !34, i32 64, i32 0} ; [ DW_TAG_arg_variable ] !46 = metadata !{i32 721153, metadata !31, metadata !"aValue", metadata !6, i32 33554436, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ] !47 = metadata !{metadata !49} |