[llvm-commits] [llvm] r105490 - in /llvm/trunk: lib/Transforms/Utils/PromoteMemoryToRegister.cpp test/Transforms/Mem2Reg/ConvertDebugInfo.ll test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
Devang Patel
dpatel at apple.com
Fri Jun 4 15:27:31 PDT 2010
Author: dpatel
Date: Fri Jun 4 17:27:30 2010
New Revision: 105490
URL: http://llvm.org/viewvc/llvm-project?rev=105490&view=rev
Log:
Copy location info for current function argument from dbg.declare if respective store instruction does not have any location info.
Modified:
llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=105490&r1=105489&r2=105490&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Fri Jun 4 17:27:30 2010
@@ -897,10 +897,8 @@
// Propagate any debug metadata from the store onto the dbg.value.
if (MDNode *SIMD = SI->getMetadata("dbg"))
DbgVal->setMetadata("dbg", SIMD);
- // Otherwise propagate debug metadata from dbg.declare for inlined fn args.
- else if (!DISubprogram(DIVar.getContext()).
- describes(DDI->getParent()->getParent()))
- if (MDNode *MD = DDI->getMetadata("dbg"))
+ // Otherwise propagate debug metadata from dbg.declare.
+ else if (MDNode *MD = DDI->getMetadata("dbg"))
DbgVal->setMetadata("dbg", MD);
}
Modified: llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo.ll?rev=105490&r1=105489&r2=105490&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo.ll (original)
+++ llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo.ll Fri Jun 4 17:27:30 2010
@@ -9,7 +9,7 @@
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
call void @llvm.dbg.declare(metadata !{i32* %i_addr}, metadata !0), !dbg !8
; CHECK: call void @llvm.dbg.value(metadata !{i32 %i}, i64 0, metadata !0)
-; CHECK: call void @llvm.dbg.value(metadata !{double %j}, i64 0, metadata !8)
+; CHECK: call void @llvm.dbg.value(metadata !{double %j}, i64 0, metadata !9)
store i32 %i, i32* %i_addr
call void @llvm.dbg.declare(metadata !{double* %j_addr}, metadata !9), !dbg !8
store double %j, double* %j_addr
Modified: llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll?rev=105490&r1=105489&r2=105490&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll (original)
+++ llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll Fri Jun 4 17:27:30 2010
@@ -1,4 +1,4 @@
-; RUN: opt -mem2reg < %s | llvm-dis | grep ".dbg " | count 6
+; RUN: opt -mem2reg < %s | llvm-dis | grep ".dbg " | count 7
declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
More information about the llvm-commits
mailing list