diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-15 22:15:46 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-15 22:15:46 +0000 |
commit | f17f34e42bbac229b51d67f989684d5cfc43a0c5 (patch) | |
tree | 0e934a20daa4f82c35070acd5a23f6fc632c3555 /llvm/test/Verifier/llvm.dbg.declare-variable.ll | |
parent | 7f5015a9cc0c6c2f6b16ecd6ac69ae898effa8de (diff) | |
download | bcm5719-llvm-f17f34e42bbac229b51d67f989684d5cfc43a0c5.tar.gz bcm5719-llvm-f17f34e42bbac229b51d67f989684d5cfc43a0c5.zip |
Verifier: Check that @llvm.dbg.* intrinsics have a !dbg attachment
Before we start to rely on valid `!dbg` attachments, add a check to the
verifier that `@llvm.dbg.*` intrinsics always have one. Also check that
the `scope:` fields point at the same `MDSubprogram`.
This is in the context of PR22778. The check that the `inlinedAt:`
fields agree has baked for a while (since r234021), so I'll kill [1] the
`MDLocalVariable::getInlinedAt()` field soon.
[1]: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150330/269387.html
Unfortunately, that means it's impossible to keep the current `Verifier`
checks, which rely on comparing `inlinedAt:` fields. We'll be able to
keep the checks I'm adding here.
If this breaks your out-of-tree testcases, the upgrade script
(add-dbg-to-intrinsics.sh) attached to PR22778 that I used for r235040
might fix them for you.
llvm-svn: 235048
Diffstat (limited to 'llvm/test/Verifier/llvm.dbg.declare-variable.ll')
-rw-r--r-- | llvm/test/Verifier/llvm.dbg.declare-variable.ll | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/test/Verifier/llvm.dbg.declare-variable.ll b/llvm/test/Verifier/llvm.dbg.declare-variable.ll index e038243bdd6..763f4637366 100644 --- a/llvm/test/Verifier/llvm.dbg.declare-variable.ll +++ b/llvm/test/Verifier/llvm.dbg.declare-variable.ll @@ -6,7 +6,7 @@ define void @foo(i32 %a) { entry: %s = alloca i32 - call void @llvm.dbg.declare(metadata i32* %s, metadata !"", metadata !MDExpression()) + call void @llvm.dbg.declare(metadata i32* %s, metadata !"", metadata !MDExpression()), !dbg !MDLocation(scope: !1) ret void } @@ -14,3 +14,4 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) !llvm.module.flags = !{!0} !0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = !MDSubprogram() |