[Debugify] Don't treat missing dbg.values as an error (PR37942)

When checking the debug info in a module, don't treat a missing
dbg.value as an error. The dbg.value may simply have been DCE'd, in
which case the debugger has enough information to display the variable
as <optimized out>.

llvm-svn: 335647
This commit is contained in:
Vedant Kumar 2018-06-26 18:54:10 +00:00
parent a374e2fb2b
commit 6431dad8b9
2 changed files with 2 additions and 3 deletions

View File

@ -94,7 +94,7 @@ define i32 @boom() {
; CHECK-FAIL: WARNING: Missing line 2
; CHECK-FAIL: WARNING: Missing line 3
; CHECK-FAIL: WARNING: Missing line 4
; CHECK-FAIL: ERROR: Missing variable 1
; CHECK-FAIL: WARNING: Missing variable 1
; CHECK-FAIL: CheckModuleDebugify: FAIL
; PASS: CheckModuleDebugify: PASS

View File

@ -226,8 +226,7 @@ bool checkDebugifyMetadata(Module &M,
dbg() << "WARNING: Missing line " << Idx + 1 << "\n";
for (unsigned Idx : MissingVars.set_bits())
dbg() << "ERROR: Missing variable " << Idx + 1 << "\n";
HasErrors |= MissingVars.count() > 0;
dbg() << "WARNING: Missing variable " << Idx + 1 << "\n";
dbg() << Banner;
if (!NameOfWrappedPass.empty())