diff options
author | Victor Hernandez <vhernandez@apple.com> | 2010-01-15 03:37:48 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2010-01-15 03:37:48 +0000 |
commit | 283ba2fbb4a40d5f7615aba070f2f7ec161d19ac (patch) | |
tree | 2b50ef9973091db7646a7325a75f13c791a5b003 /test | |
parent | 8396a17bc3a6d2cb9aedd22fc15780ac8ab41662 (diff) |
Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Assembler/functionlocal-metadata.ll | 20 | ||||
-rw-r--r-- | test/DebugInfo/2009-10-16-Scope.ll | 5 | ||||
-rw-r--r-- | test/DebugInfo/printdbginfo2.ll | 6 |
3 files changed, 14 insertions, 17 deletions
diff --git a/test/Assembler/functionlocal-metadata.ll b/test/Assembler/functionlocal-metadata.ll index 9d83304e89..8265aa1d3b 100644 --- a/test/Assembler/functionlocal-metadata.ll +++ b/test/Assembler/functionlocal-metadata.ll @@ -5,23 +5,21 @@ entry: %0 = add i32 %a, 1 ; <i32> [#uses=1] %two = add i32 %b, %0 ; <i32> [#uses=0] %1 = alloca i32 ; <i32*> [#uses=1] - %three = bitcast i32* %1 to { }* ; <{ }*> [#uses=6] - call void @llvm.dbg.declare({ }* %three, metadata !{i32* %1}) -; CHECK: metadata !{i32* %1} - call void @llvm.dbg.declare({ }* %three, metadata !{{ }* %three}) - call void @llvm.dbg.declare({ }* %three, metadata !{i32 %0}) - call void @llvm.dbg.declare({ }* %three, metadata !{{ }* %three, i32 %0}) - call void @llvm.dbg.declare({ }* %three, metadata !{i32 %b, i32 %0}) - call void @llvm.dbg.declare({ }* %three, metadata !{i32 %a, metadata !"foo"}) + call void @llvm.dbg.declare(metadata !{i32* %1}, metadata !{i32* %1}) +; CHECK: metadata !{i32* %1}, metadata !{i32* %1} + call void @llvm.dbg.declare(metadata !{i32 %two}, metadata !{i32 %0}) + call void @llvm.dbg.declare(metadata !{i32 %0}, metadata !{i32* %1, i32 %0}) + call void @llvm.dbg.declare(metadata !{i32* %1}, metadata !{i32 %b, i32 %0}) + call void @llvm.dbg.declare(metadata !{i32 %a}, metadata !{i32 %a, metadata !"foo"}) ; CHECK: metadata !{i32 %a, metadata !"foo"} - call void @llvm.dbg.declare({ }* %three, metadata !{metadata !0, i32 %two}) + call void @llvm.dbg.declare(metadata !{i32 %b}, metadata !{metadata !0, i32 %two}) call void @llvm.dbg.value(metadata !{ i32 %a }, i64 0, metadata !1) call void @llvm.dbg.value(metadata !{ i32 %0 }, i64 25, metadata !0) call void @llvm.dbg.value(metadata !{ i32* %1 }, i64 16, metadata !"foo") ; CHECK: call void @llvm.dbg.value(metadata !{i32* %1}, i64 16, metadata !"foo") - call void @llvm.dbg.value(metadata !{ { }* %three }, i64 12, metadata !"bar") + call void @llvm.dbg.value(metadata !"foo", i64 12, metadata !"bar") ret void, !foo !0, !bar !1 ; CHECK: ret void, !foo !0, !bar !1 @@ -30,7 +28,7 @@ entry: !0 = metadata !{i32 662302, i32 26, metadata !1, null} !1 = metadata !{i32 4, metadata !"foo"} -declare void @llvm.dbg.declare({ }*, metadata) nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone !foo = !{ !0 } diff --git a/test/DebugInfo/2009-10-16-Scope.ll b/test/DebugInfo/2009-10-16-Scope.ll index ea43249668..9f9fa65d5b 100644 --- a/test/DebugInfo/2009-10-16-Scope.ll +++ b/test/DebugInfo/2009-10-16-Scope.ll @@ -9,8 +9,7 @@ entry: br label %do.body, !dbg !0 do.body: ; preds = %entry - %0 = bitcast i32* %count_ to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %0, metadata !4) + call void @llvm.dbg.declare(metadata !{i32* %count_}, metadata !4) %conv = ptrtoint i32* %count_ to i32, !dbg !0 ; <i32> [#uses=1] %call = call i32 @foo(i32 %conv) ssp, !dbg !0 ; <i32> [#uses=0] br label %do.end, !dbg !0 @@ -19,7 +18,7 @@ do.end: ; preds = %do.body ret void, !dbg !7 } -declare void @llvm.dbg.declare({ }*, metadata) nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone declare i32 @foo(i32) ssp diff --git a/test/DebugInfo/printdbginfo2.ll b/test/DebugInfo/printdbginfo2.ll index 759310fc9f..e19395b0df 100644 --- a/test/DebugInfo/printdbginfo2.ll +++ b/test/DebugInfo/printdbginfo2.ll @@ -19,11 +19,11 @@ entry: call void @llvm.dbg.stoppoint(i32 6, i32 3, metadata !1) call void @llvm.dbg.stoppoint(i32 7, i32 3, metadata !1) %0 = bitcast %struct.foo* %b to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %0, metadata !4) + call void @llvm.dbg.declare(metadata !{%struct.foo* %b}, metadata !4) ; CHECK:; %0 is variable b of type foo declared at x.c:7 call void @llvm.dbg.stoppoint(i32 8, i32 3, metadata !1) %1 = bitcast [4 x i32]* %a to { }* ; <{ }*> [#uses=1] - call void @llvm.dbg.declare({ }* %1, metadata !8) + call void @llvm.dbg.declare(metadata !{[4 x i32]* %a}, metadata !8) ; CHECK:; %1 is variable a of type declared at x.c:8 call void @llvm.dbg.stoppoint(i32 9, i32 3, metadata !1) %tmp = getelementptr inbounds %struct.foo* %b, i32 0, i32 0 ; <i32*> [#uses=1] @@ -46,7 +46,7 @@ declare void @llvm.dbg.func.start(metadata) nounwind readnone declare void @llvm.dbg.stoppoint(i32, i32, metadata) nounwind readnone -declare void @llvm.dbg.declare({ }*, metadata) nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone declare void @llvm.dbg.region.end(metadata) nounwind readnone |