[llvm-commits] [llvm] r106515 - in /llvm/trunk/lib: Analysis/DebugInfo.cpp CodeGen/AsmPrinter/DwarfDebug.cpp
Devang Patel
dpatel at apple.com
Mon Jun 21 18:01:58 PDT 2010
Author: dpatel
Date: Mon Jun 21 20:01:58 2010
New Revision: 106515
URL: http://llvm.org/viewvc/llvm-project?rev=106515&view=rev
Log:
Do not rely on Twine temporaries to survive.
Modified:
llvm/trunk/lib/Analysis/DebugInfo.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=106515&r1=106514&r2=106515&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Mon Jun 21 20:01:58 2010
@@ -1059,14 +1059,14 @@
StringRef FName = "fn";
if (Fn.getFunction())
FName = Fn.getFunction()->getName();
- const Twine FnLVName = Twine("llvm.dbg.lv.", FName);
char One = '\1';
if (FName.startswith(StringRef(&One, 1)))
FName = FName.substr(1);
-
- NamedMDNode *FnLocals = M.getNamedMetadataUsingTwine(FnLVName);
+ NamedMDNode *FnLocals =
+ M.getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", FName));
if (!FnLocals)
- FnLocals = NamedMDNode::Create(VMContext, FnLVName, NULL, 0, &M);
+ FnLocals = NamedMDNode::Create(VMContext, Twine("llvm.dbg.lv.", FName),
+ NULL, 0, &M);
FnLocals->addOperand(Node);
}
return DIVariable(Node);
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=106515&r1=106514&r2=106515&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jun 21 20:01:58 2010
@@ -2257,9 +2257,10 @@
}
// Collect info for variables that were optimized out.
- const Twine FnLVName = Twine("llvm.dbg.lv.", MF->getFunction()->getName());
- if (NamedMDNode *NMD =
- MF->getFunction()->getParent()->getNamedMetadataUsingTwine(FnLVName)) {
+ const Function *F = MF->getFunction();
+ const Module *M = F->getParent();
+ if (NamedMDNode *NMD =
+ M->getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", F->getName()))) {
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
DIVariable DV(cast_or_null<MDNode>(NMD->getOperand(i)));
if (!DV || !Processed.insert(DV))
More information about the llvm-commits
mailing list