Skip to content

Commit 2504c8d

Browse files
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 llvm/llvm-project@e6b0221 added `TargetExtTyID` to the `TypeID` enum. This adapts `RustWrapper` accordingly.
2 parents bdcfa6c + 799fa60 commit 2504c8d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

Diff for: compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+9-11
Original file line numberDiff line numberDiff line change
@@ -1349,18 +1349,16 @@ extern "C" LLVMTypeKind LLVMRustGetTypeKind(LLVMTypeRef Ty) {
13491349
return LLVMBFloatTypeKind;
13501350
case Type::X86_AMXTyID:
13511351
return LLVMX86_AMXTypeKind;
1352-
#if LLVM_VERSION_GE(15, 0) && LLVM_VERSION_LT(16, 0)
1353-
case Type::DXILPointerTyID:
1354-
report_fatal_error("Rust does not support DirectX typed pointers.");
1355-
break;
1356-
#endif
1357-
#if LLVM_VERSION_GE(16, 0)
1358-
case Type::TypedPointerTyID:
1359-
report_fatal_error("Rust does not support typed pointers.");
1360-
break;
1361-
#endif
1352+
default:
1353+
{
1354+
std::string error;
1355+
llvm::raw_string_ostream stream(error);
1356+
stream << "Rust does not support the TypeID: " << unwrap(Ty)->getTypeID()
1357+
<< " for the type: " << *unwrap(Ty);
1358+
stream.flush();
1359+
report_fatal_error(error.c_str());
1360+
}
13621361
}
1363-
report_fatal_error("Unhandled TypeID.");
13641362
}
13651363

13661364
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(SMDiagnostic, LLVMSMDiagnosticRef)

0 commit comments

Comments
 (0)