aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-06-16 00:53:55 +0000
committerDevang Patel <dpatel@apple.com>2010-06-16 00:53:55 +0000
commita6d20f446fe3b19112e54dc7f1468b3ff0f2f50a (patch)
tree24f7e34a01e20f46ac77c0123fd57f836b0200a0 /llvm/lib/Analysis/DebugInfo.cpp
parent6972a62c8feda5ac53125978170f89657d978d4e (diff)
downloadllvm-a6d20f446fe3b19112e54dc7f1468b3ff0f2f50a.zip
llvm-a6d20f446fe3b19112e54dc7f1468b3ff0f2f50a.tar.gz
llvm-a6d20f446fe3b19112e54dc7f1468b3ff0f2f50a.tar.bz2
Use separate named MDNode to hold each function's local variable info.
This speeds up local variable handling in DwarfDebug. llvm-svn: 106075
Diffstat (limited to 'llvm/lib/Analysis/DebugInfo.cpp')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index 774dce0..6ef160b 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -1053,8 +1053,12 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context,
// The optimizer may remove local variable. If there is an interest
// to preserve variable info in such situation then stash it in a
// named mdnode.
- NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.lv");
- NMD->addOperand(Node);
+ DISubprogram Fn(getDISubprogram(Context));
+ const Twine FnLVName = Twine("llvm.dbg.lv.", Fn.getName());
+ NamedMDNode *FnLocals = M.getNamedMetadataUsingTwine(FnLVName);
+ if (!FnLocals)
+ FnLocals = NamedMDNode::Create(VMContext, FnLVName, NULL, 0, &M);
+ FnLocals->addOperand(Node);
}
return DIVariable(Node);
}