[llvm-commits] [llvm] r106075 - in /llvm/trunk: include/llvm/Module.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/VMCore/Module.cpp
Devang Patel
dpatel at apple.com
Mon Jun 21 18:02:24 PDT 2010
On Jun 21, 2010, at 5:27 PM, Chris Lattner wrote:
>> +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Tue Jun 15 19:53:55 2010
>> @@ -1053,8 +1053,12 @@
>> // 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.
> ..
>> + DISubprogram Fn(getDISubprogram(Context));
>> + const Twine FnLVName = Twine("llvm.dbg.lv.", Fn.getName());
>> + NamedMDNode *FnLocals = M.getNamedMetadataUsingTwine(FnLVName);
>
> This is just barely safe, but is really dangerous. Please use:
>
> NamedMDNode *FnLocals = M.getNamedMetadata(Twine("llvm.dbg.lv.")+Fn.getName());
>
> The temporaries are destroyed at the end of the statement.
Fixed. I'll use separate patch for other changes.
Thanks for the review!
-
Devang
More information about the llvm-commits
mailing list