Skip to content

Commit

Permalink
Rollup merge of rust-lang#106113 - krasimirgg:llvm-16-ext-tyid, r=nikic
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
compiler-errors authored Jan 22, 2023
2 parents 3c10728 + 799fa60 commit 6472f31
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6472f31

Please sign in to comment.