diff options
author | Krasimir Georgiev <krasimir@google.com> | 2022-12-24 08:19:20 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2023-01-02 14:31:05 +0000 |
commit | 799fa60c07784bb033d1e1bcdcc7f671ea47d617 (patch) | |
tree | 74e85f3f082ef1581eccfaa501d3d87b4da2b2f8 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
parent | 4f4d0586ad20c66a16d547581ca379beafece93a (diff) | |
download | rust-799fa60c07784bb033d1e1bcdcc7f671ea47d617.tar.gz |
llvm-wrapper: adapt for LLVM API change
No functional changes intended.
The LLVM commit https://github.com/llvm/llvm-project/commit/e6b02214c68df2c9f826e02310c9352ac652e456 added `TargetExtTyID` to the `TypeID` enum. This adapts `RustWrapper` accordingly.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
-rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 279b6991854..a26da9d548f 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1349,18 +1349,16 @@ extern "C" LLVMTypeKind LLVMRustGetTypeKind(LLVMTypeRef Ty) { return LLVMBFloatTypeKind; case Type::X86_AMXTyID: return LLVMX86_AMXTypeKind; -#if LLVM_VERSION_GE(15, 0) && LLVM_VERSION_LT(16, 0) - case Type::DXILPointerTyID: - report_fatal_error("Rust does not support DirectX typed pointers."); - break; -#endif -#if LLVM_VERSION_GE(16, 0) - case Type::TypedPointerTyID: - report_fatal_error("Rust does not support typed pointers."); - break; -#endif + default: + { + std::string error; + llvm::raw_string_ostream stream(error); + stream << "Rust does not support the TypeID: " << unwrap(Ty)->getTypeID() + << " for the type: " << *unwrap(Ty); + stream.flush(); + report_fatal_error(error.c_str()); + } } - report_fatal_error("Unhandled TypeID."); } DEFINE_SIMPLE_CONVERSION_FUNCTIONS(SMDiagnostic, LLVMSMDiagnosticRef) |