about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-01-21 23:20:58 -0500
committerGitHub <noreply@github.com>2023-01-21 23:20:58 -0500
commit2504c8d1ee4f904d3ecd95ec19cbed22ed046295 (patch)
treecf5aac25f2e0a6e1f4d36e3d3b6dab52c33c1234 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentbdcfa6c9aa9117f9727cc9fde42eeefc2794a233 (diff)
parent799fa60c07784bb033d1e1bcdcc7f671ea47d617 (diff)
downloadrust-2504c8d1ee4f904d3ecd95ec19cbed22ed046295.tar.gz
rust-2504c8d1ee4f904d3ecd95ec19cbed22ed046295.zip
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 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.cpp20
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 8f94e8a4ab2..87b0e1273eb 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)