1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

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.
This commit is contained in:
Simon Pilgrim 2021-06-08 17:33:59 +01:00
parent 873ac8ce7c
commit 838b0a9266

View File

@ -130,6 +130,7 @@ static ffi_type *ffiTypeFor(Type *Ty) {
case 32: return &ffi_type_sint32; case 32: return &ffi_type_sint32;
case 64: return &ffi_type_sint64; case 64: return &ffi_type_sint64;
} }
llvm_unreachable("Unhandled integer type bitwidth");
case Type::FloatTyID: return &ffi_type_float; case Type::FloatTyID: return &ffi_type_float;
case Type::DoubleTyID: return &ffi_type_double; case Type::DoubleTyID: return &ffi_type_double;
case Type::PointerTyID: return &ffi_type_pointer; case Type::PointerTyID: return &ffi_type_pointer;
@ -166,7 +167,7 @@ static void *ffiValueFor(Type *Ty, const GenericValue &AV,
return ArgDataPtr; return ArgDataPtr;
} }
} }
break; llvm_unreachable("Unhandled integer type bitwidth");
case Type::FloatTyID: { case Type::FloatTyID: {
float *FloatPtr = (float *) ArgDataPtr; float *FloatPtr = (float *) ArgDataPtr;
*FloatPtr = AV.FloatVal; *FloatPtr = AV.FloatVal;