diff options
author | Devang Patel <dpatel@apple.com> | 2010-06-16 00:53:55 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-06-16 00:53:55 +0000 |
commit | 2f7d5291de87bfa195884e84dc0efe9705c2215c (patch) | |
tree | 08cfc02c5cca206415b6ddac7a87431a8341f533 /lib/Analysis/DebugInfo.cpp | |
parent | 7500e06e3886a13e3017d7af77c35d309e875182 (diff) | |
download | external_llvm-2f7d5291de87bfa195884e84dc0efe9705c2215c.zip external_llvm-2f7d5291de87bfa195884e84dc0efe9705c2215c.tar.gz external_llvm-2f7d5291de87bfa195884e84dc0efe9705c2215c.tar.bz2 |
Use separate named MDNode to hold each function's local variable info.
This speeds up local variable handling in DwarfDebug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106075 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 774dce0..6ef160b 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/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); } |