[llvm] c1cad15 - [debugify] Demote an error about empty locations to a warning

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 14:55:10 PDT 2020


Author: Vedant Kumar
Date: 2020-06-26T14:55:02-07:00
New Revision: c1cad151b03c2b05983d569ba3bc05fd74d4dfdc

URL: https://github.com/llvm/llvm-project/commit/c1cad151b03c2b05983d569ba3bc05fd74d4dfdc
DIFF: https://github.com/llvm/llvm-project/commit/c1cad151b03c2b05983d569ba3bc05fd74d4dfdc.diff

LOG: [debugify] Demote an error about empty locations to a warning

In https://reviews.llvm.org/D81198, we outlined a number of scenarios
where dropping debug locations is appropriate. Stop issuing an error
when this happens.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/Debugify.cpp
    llvm/test/DebugInfo/debugify-report-missing-locs-only.ll
    llvm/test/DebugInfo/debugify.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp
index 7c178aba5ad2..8f98d81a3d79 100644
--- a/llvm/lib/Transforms/Utils/Debugify.cpp
+++ b/llvm/lib/Transforms/Utils/Debugify.cpp
@@ -330,11 +330,10 @@ bool checkDebugifyMetadata(Module &M,
       }
 
       if (!DL) {
-        dbg() << "ERROR: Instruction with empty DebugLoc in function ";
+        dbg() << "WARNING: Instruction with empty DebugLoc in function ";
         dbg() << F.getName() << " --";
         I.print(dbg());
         dbg() << "\n";
-        HasErrors = true;
       }
     }
 

diff  --git a/llvm/test/DebugInfo/debugify-report-missing-locs-only.ll b/llvm/test/DebugInfo/debugify-report-missing-locs-only.ll
index 43682768c582..abf392f531d5 100644
--- a/llvm/test/DebugInfo/debugify-report-missing-locs-only.ll
+++ b/llvm/test/DebugInfo/debugify-report-missing-locs-only.ll
@@ -1,6 +1,6 @@
-; RUN: opt -check-debugify < %s -S -o - 2>&1 | FileCheck %s -implicit-check-not "ERROR: Instruction with empty DebugLoc in function bar"
+; RUN: opt -check-debugify < %s -S -o - 2>&1 | FileCheck %s -implicit-check-not "WARNING: Instruction with empty DebugLoc in function bar"
 
-; CHECK: ERROR: Instruction with empty DebugLoc in function foo --   ret void
+; CHECK: WARNING: Instruction with empty DebugLoc in function foo --   ret void
 define void @foo() !dbg !6 {
   ret void
 }

diff  --git a/llvm/test/DebugInfo/debugify.ll b/llvm/test/DebugInfo/debugify.ll
index 89f62e2dbaae..e821ce06c2c7 100644
--- a/llvm/test/DebugInfo/debugify.ll
+++ b/llvm/test/DebugInfo/debugify.ll
@@ -14,10 +14,10 @@
 ; RUN:   FileCheck %s -implicit-check-not="CheckModuleDebugify: FAIL"
 
 ; RUN: opt -debugify -strip -check-debugify -S -o - < %s 2>&1 | \
-; RUN:   FileCheck %s -check-prefix=CHECK-FAIL
+; RUN:   FileCheck %s -check-prefix=CHECK-WARN
 
 ; RUN: opt -enable-debugify -strip -S -o - < %s 2>&1 | \
-; RUN:   FileCheck %s -check-prefix=CHECK-FAIL
+; RUN:   FileCheck %s -check-prefix=CHECK-WARN
 
 ; RUN: opt -enable-debugify -S -o - < %s 2>&1 | FileCheck %s -check-prefix=PASS
 
@@ -88,15 +88,15 @@ define i32 @boom() {
 ; CHECK-REPEAT: ModuleDebugify: Skipping module with debug info
 
 ; --- Failure case
-; CHECK-FAIL: ERROR: Instruction with empty DebugLoc in function foo --   ret void
-; CHECK-FAIL: ERROR: Instruction with empty DebugLoc in function bar --   call void @foo()
-; CHECK-FAIL: ERROR: Instruction with empty DebugLoc in function bar --   {{.*}} add i32 0, 1
-; CHECK-FAIL: ERROR: Instruction with empty DebugLoc in function bar --   ret i32 0
-; CHECK-FAIL: WARNING: Missing line 1
-; CHECK-FAIL: WARNING: Missing line 2
-; CHECK-FAIL: WARNING: Missing line 3
-; CHECK-FAIL: WARNING: Missing line 4
-; CHECK-FAIL: WARNING: Missing variable 1
-; CHECK-FAIL: CheckModuleDebugify: FAIL
+; CHECK-WARN: WARNING: Instruction with empty DebugLoc in function foo --   ret void
+; CHECK-WARN: WARNING: Instruction with empty DebugLoc in function bar --   call void @foo()
+; CHECK-WARN: WARNING: Instruction with empty DebugLoc in function bar --   {{.*}} add i32 0, 1
+; CHECK-WARN: WARNING: Instruction with empty DebugLoc in function bar --   ret i32 0
+; CHECK-WARN: WARNING: Missing line 1
+; CHECK-WARN: WARNING: Missing line 2
+; CHECK-WARN: WARNING: Missing line 3
+; CHECK-WARN: WARNING: Missing line 4
+; CHECK-WARN: WARNING: Missing variable 1
+; CHECK-WARN: CheckModuleDebugify: PASS
 
 ; PASS: CheckModuleDebugify: PASS


        


More information about the llvm-commits mailing list