[llvm] 525c25a - [SPIRV] Fix warning in SPIRVMergeRegionExitTargets.cpp (#95283)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 08:12:44 PDT 2024


Author: Helena Kotas
Date: 2024-06-13T08:12:41-07:00
New Revision: 525c25acd364f018b4fa55e941bd702587478b1c

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

LOG: [SPIRV] Fix warning in SPIRVMergeRegionExitTargets.cpp (#95283)

Fix warning in SPIRVMergeRegionExitTargets.cpp about "non-void function
does not return a value in all control paths" by changing assert to
llvm_unreachable.

Added: 
    

Modified: 
    llvm/lib/Target/SPIRV/SPIRVMergeRegionExitTargets.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SPIRV/SPIRVMergeRegionExitTargets.cpp b/llvm/lib/Target/SPIRV/SPIRVMergeRegionExitTargets.cpp
index 52354281cdd7e..0747dd1bbaf40 100644
--- a/llvm/lib/Target/SPIRV/SPIRVMergeRegionExitTargets.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVMergeRegionExitTargets.cpp
@@ -100,7 +100,7 @@ class SPIRVMergeRegionExitTargets : public FunctionPass {
     }
 
     // TODO: add support for switch cases.
-    assert(false && "Unhandled terminator type.");
+    llvm_unreachable("Unhandled terminator type.");
   }
 
   /// Replaces |BB|'s branch targets present in |ToReplace| with |NewTarget|.


        


More information about the llvm-commits mailing list