Replace `unreachable!` with `panic!`, as this code may be reached now
@@ -237,7 +237,8 @@ impl<'ctx> AnyTypeEnum<'ctx> {
feature = "llvm14-0"
))]
LLVMTypeKind::LLVMScalableVectorTypeKind => AnyTypeEnum::VectorType(VectorType::new(type_)),
- LLVMTypeKind::LLVMMetadataTypeKind => unreachable!("Metadata type is not supported as AnyType."),
+ // FIXME: should inkwell support metadata as AnyType?
+ LLVMTypeKind::LLVMMetadataTypeKind => panic!("Metadata type is not supported as AnyType."),
LLVMTypeKind::LLVMX86_MMXTypeKind => panic!("FIXME: Unsupported type: MMX"),
#[cfg(any(feature = "llvm12-0", feature = "llvm13-0", feature = "llvm14-0"))]
LLVMTypeKind::LLVMX86_AMXTypeKind => panic!("FIXME: Unsupported type: AMX"),
@@ -406,16 +407,16 @@ impl<'ctx> BasicTypeEnum<'ctx> {
feature = "llvm14-0"
))]
LLVMTypeKind::LLVMScalableVectorTypeKind => BasicTypeEnum::VectorType(VectorType::new(type_)),
- LLVMTypeKind::LLVMMetadataTypeKind => unreachable!("Unsupported basic type: Metadata"),
+ LLVMTypeKind::LLVMMetadataTypeKind => panic!("Unsupported basic type: Metadata"),
// see https://llvm.org/docs/LangRef.html#x86-mmx-type
- LLVMTypeKind::LLVMX86_MMXTypeKind => unreachable!("Unsupported basic type: MMX"),
+ LLVMTypeKind::LLVMX86_MMXTypeKind => panic!("Unsupported basic type: MMX"),
// see https://llvm.org/docs/LangRef.html#x86-amx-type
#[cfg(any(feature = "llvm12-0", feature = "llvm13-0", feature = "llvm14-0"))]
- LLVMTypeKind::LLVMX86_AMXTypeKind => unreachable!("Unsupported basic type: AMX"),
- LLVMTypeKind::LLVMLabelTypeKind => unreachable!("Unsupported basic type: Label"),
- LLVMTypeKind::LLVMVoidTypeKind => unreachable!("Unsupported basic type: VoidType"),
- LLVMTypeKind::LLVMFunctionTypeKind => unreachable!("Unsupported basic type: FunctionType"),
- LLVMTypeKind::LLVMTokenTypeKind => unreachable!("Unsupported basic type: Token"),
+ LLVMTypeKind::LLVMX86_AMXTypeKind => panic!("Unsupported basic type: AMX"),
+ LLVMTypeKind::LLVMLabelTypeKind => panic!("Unsupported basic type: Label"),
+ LLVMTypeKind::LLVMVoidTypeKind => panic!("Unsupported basic type: VoidType"),
+ LLVMTypeKind::LLVMFunctionTypeKind => panic!("Unsupported basic type: FunctionType"),
+ LLVMTypeKind::LLVMTokenTypeKind => panic!("Unsupported basic type: Token"),
}
}
