[llvm] r323216 - Verifier: fix bug treating debug info issue as non-debug info issue
Yaxun Liu via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 23 08:11:15 PST 2018
Author: yaxunl
Date: Tue Jan 23 08:11:15 2018
New Revision: 323216
URL: http://llvm.org/viewvc/llvm-project?rev=323216&view=rev
Log:
Verifier: fix bug treating debug info issue as non-debug info issue
Normally when llvm-as sees only debug info errors in LLVM assembly, it simply
drops the debug info and outputs a valid LLVM bitcode and returns 0.
There is a bug in LLVM verifier which incorrectly treats a debug info error
as non-debug info error, which causes llvm-as returns 1 even though llvm-as
can drop the invalid debug info and outputs a valid LLVM bitcode.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D42391
Modified:
llvm/trunk/lib/IR/Verifier.cpp
llvm/trunk/test/Verifier/llvm.dbg.intrinsic-dbg-attachment.ll
Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=323216&r1=323215&r2=323216&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Tue Jan 23 08:11:15 2018
@@ -4525,8 +4525,8 @@ void Verifier::visitDbgIntrinsic(StringR
// The scopes for variables and !dbg attachments must agree.
DILocalVariable *Var = DII.getVariable();
DILocation *Loc = DII.getDebugLoc();
- Assert(Loc, "llvm.dbg." + Kind + " intrinsic requires a !dbg attachment",
- &DII, BB, F);
+ AssertDI(Loc, "llvm.dbg." + Kind + " intrinsic requires a !dbg attachment",
+ &DII, BB, F);
DISubprogram *VarSP = getSubprogram(Var->getRawScope());
DISubprogram *LocSP = getSubprogram(Loc->getRawScope());
Modified: llvm/trunk/test/Verifier/llvm.dbg.intrinsic-dbg-attachment.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/llvm.dbg.intrinsic-dbg-attachment.ll?rev=323216&r1=323215&r2=323216&view=diff
==============================================================================
--- llvm/trunk/test/Verifier/llvm.dbg.intrinsic-dbg-attachment.ll (original)
+++ llvm/trunk/test/Verifier/llvm.dbg.intrinsic-dbg-attachment.ll Tue Jan 23 08:11:15 2018
@@ -1,4 +1,4 @@
-; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
+; RUN: llvm-as -disable-output <%s 2>&1 | FileCheck %s
define void @foo() {
entry:
call void @llvm.dbg.value(
More information about the llvm-commits
mailing list