diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2021-06-08 17:33:59 +0100 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2021-06-08 17:59:05 +0100 |
commit | 52396577a2d85ef1b18f86e643fe3b1033750e15 (patch) | |
tree | a8c2f36f5ded4fc4e5f4758ebcf3b5b31dce7e2e /llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | |
parent | 01b77159e30b38613ab700d8bb128b006822c58c (diff) | |
download | llvm-52396577a2d85ef1b18f86e643fe3b1033750e15.zip llvm-52396577a2d85ef1b18f86e643fe3b1033750e15.tar.gz llvm-52396577a2d85ef1b18f86e643fe3b1033750e15.tar.bz2 |
Use llvm_unreachable for unsupported integer types.
As suggested on rG937c4cffd024, use llvm_unreachable for unhandled integer types (which shouldn't be possible) instead of breaking and dropping down to the existing fatal error handler.
Helps silence static analyzer warnings.
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index 8d4a198..c3ba5eb 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -130,6 +130,7 @@ static ffi_type *ffiTypeFor(Type *Ty) { case 32: return &ffi_type_sint32; case 64: return &ffi_type_sint64; } + llvm_unreachable("Unhandled integer type bitwidth"); case Type::FloatTyID: return &ffi_type_float; case Type::DoubleTyID: return &ffi_type_double; case Type::PointerTyID: return &ffi_type_pointer; @@ -166,7 +167,7 @@ static void *ffiValueFor(Type *Ty, const GenericValue &AV, return ArgDataPtr; } } - break; + llvm_unreachable("Unhandled integer type bitwidth"); case Type::FloatTyID: { float *FloatPtr = (float *) ArgDataPtr; *FloatPtr = AV.FloatVal; |