Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic

llvm-wrapper: adapt for LLVM API change

No functional changes intended.

The LLVM commit e6b02214c6 added `TargetExtTyID` to the `TypeID` enum. This adapts `RustWrapper` accordingly.
This commit is contained in:
Michael Goulet 2023-01-21 23:20:58 -05:00 committed by GitHub
commit 2504c8d1ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1349,18 +1349,16 @@ extern "C" LLVMTypeKind LLVMRustGetTypeKind(LLVMTypeRef Ty) {
return LLVMBFloatTypeKind; return LLVMBFloatTypeKind;
case Type::X86_AMXTyID: case Type::X86_AMXTyID:
return LLVMX86_AMXTypeKind; return LLVMX86_AMXTypeKind;
#if LLVM_VERSION_GE(15, 0) && LLVM_VERSION_LT(16, 0) default:
case Type::DXILPointerTyID: {
report_fatal_error("Rust does not support DirectX typed pointers."); std::string error;
break; llvm::raw_string_ostream stream(error);
#endif stream << "Rust does not support the TypeID: " << unwrap(Ty)->getTypeID()
#if LLVM_VERSION_GE(16, 0) << " for the type: " << *unwrap(Ty);
case Type::TypedPointerTyID: stream.flush();
report_fatal_error("Rust does not support typed pointers."); report_fatal_error(error.c_str());
break; }
#endif
} }
report_fatal_error("Unhandled TypeID.");
} }
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(SMDiagnostic, LLVMSMDiagnosticRef) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(SMDiagnostic, LLVMSMDiagnosticRef)