[llvm] 52967a5 - [InstCombine] Fix a crash in -kcfi debug block

Sami Tolvanen via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 15:59:51 PDT 2022


Author: Sami Tolvanen
Date: 2022-09-07T22:59:12Z
New Revision: 52967a530695bb9ffd24bb61a22a558f2f494187

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

LOG: [InstCombine] Fix a crash in -kcfi debug block

Don't attempt to print out DebugLoc as we may not have one.

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index dea91c26e8516..e432d9a3d222e 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -3116,8 +3116,7 @@ Instruction *InstCombinerImpl::visitCallBase(CallBase &Call) {
 
         if (FunctionType &&
             FunctionType->getZExtValue() != ExpectedType->getZExtValue())
-          dbgs() << Call.getModule()->getName() << ":"
-                 << Call.getDebugLoc().getLine()
+          dbgs() << Call.getModule()->getName()
                  << ": warning: kcfi: " << Call.getCaller()->getName()
                  << ": call to " << CalleeF->getName()
                  << " using a mismatching function pointer type\n";


        


More information about the llvm-commits mailing list