[llvm-commits] [llvm] r104274 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/Analysis/DebugInfo.cpp
Devang Patel
dpatel at apple.com
Thu May 20 13:35:24 PDT 2010
Author: dpatel
Date: Thu May 20 15:35:24 2010
New Revision: 104274
URL: http://llvm.org/viewvc/llvm-project?rev=104274&view=rev
Log:
Rename variable. add comment.
Modified:
llvm/trunk/include/llvm/Analysis/DebugInfo.h
llvm/trunk/lib/Analysis/DebugInfo.cpp
Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=104274&r1=104273&r2=104274&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Thu May 20 15:35:24 2010
@@ -677,7 +677,7 @@
DIVariable CreateVariable(unsigned Tag, DIDescriptor Context,
StringRef Name,
DIFile F, unsigned LineNo,
- DIType Ty, bool OptimizedBuild = false);
+ DIType Ty, bool AlwaysPreserve = false);
/// CreateComplexVariable - Create a new descriptor for the specified
/// variable which has a complex address expression for its address.
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=104274&r1=104273&r2=104274&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Thu May 20 15:35:24 2010
@@ -1028,7 +1028,7 @@
StringRef Name,
DIFile F,
unsigned LineNo,
- DIType Ty, bool OptimizedBuild) {
+ DIType Ty, bool AlwaysPreserve) {
Value *Elts[] = {
GetTagConstant(Tag),
Context,
@@ -1038,7 +1038,10 @@
Ty,
};
MDNode *Node = MDNode::get(VMContext, &Elts[0], 6);
- if (OptimizedBuild) {
+ if (AlwaysPreserve) {
+ // 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);
}
More information about the llvm-commits
mailing list