Rollup merge of #100460 - cuviper:drop-llvm-12, r=nagisa
Update the minimum external LLVM to 13 With this change, we'll have stable support for LLVM 13 through 15 (pending release). For reference, the previous increase to LLVM 12 was #90175. r? `@nagisa`
This commit is contained in:
commit
0b19a185db
34 changed files with 46 additions and 289 deletions
|
@ -413,18 +413,12 @@ LLVMRustBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Target,
|
|||
LLVMValueRef Old, LLVMValueRef Source,
|
||||
LLVMAtomicOrdering Order,
|
||||
LLVMAtomicOrdering FailureOrder, LLVMBool Weak) {
|
||||
#if LLVM_VERSION_GE(13,0)
|
||||
// Rust probably knows the alignment of the target value and should be able to
|
||||
// specify something more precise than MaybeAlign here. See also
|
||||
// https://reviews.llvm.org/D97224 which may be a useful reference.
|
||||
AtomicCmpXchgInst *ACXI = unwrap(B)->CreateAtomicCmpXchg(
|
||||
unwrap(Target), unwrap(Old), unwrap(Source), llvm::MaybeAlign(), fromRust(Order),
|
||||
fromRust(FailureOrder));
|
||||
#else
|
||||
AtomicCmpXchgInst *ACXI = unwrap(B)->CreateAtomicCmpXchg(
|
||||
unwrap(Target), unwrap(Old), unwrap(Source), fromRust(Order),
|
||||
fromRust(FailureOrder));
|
||||
#endif
|
||||
ACXI->setWeak(Weak);
|
||||
return wrap(ACXI);
|
||||
}
|
||||
|
@ -472,19 +466,11 @@ LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen,
|
|||
char *Constraints, size_t ConstraintsLen,
|
||||
LLVMBool HasSideEffects, LLVMBool IsAlignStack,
|
||||
LLVMRustAsmDialect Dialect, LLVMBool CanThrow) {
|
||||
#if LLVM_VERSION_GE(13, 0)
|
||||
return wrap(InlineAsm::get(unwrap<FunctionType>(Ty),
|
||||
StringRef(AsmString, AsmStringLen),
|
||||
StringRef(Constraints, ConstraintsLen),
|
||||
HasSideEffects, IsAlignStack,
|
||||
fromRust(Dialect), CanThrow));
|
||||
#else
|
||||
return wrap(InlineAsm::get(unwrap<FunctionType>(Ty),
|
||||
StringRef(AsmString, AsmStringLen),
|
||||
StringRef(Constraints, ConstraintsLen),
|
||||
HasSideEffects, IsAlignStack,
|
||||
fromRust(Dialect)));
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
|
||||
|
@ -1274,10 +1260,8 @@ static LLVMRustDiagnosticKind toRust(DiagnosticKind Kind) {
|
|||
return LLVMRustDiagnosticKind::Linker;
|
||||
case DK_Unsupported:
|
||||
return LLVMRustDiagnosticKind::Unsupported;
|
||||
#if LLVM_VERSION_GE(13, 0)
|
||||
case DK_SrcMgr:
|
||||
return LLVMRustDiagnosticKind::SrcMgr;
|
||||
#endif
|
||||
default:
|
||||
return (Kind >= DK_FirstRemark && Kind <= DK_LastRemark)
|
||||
? LLVMRustDiagnosticKind::OptimizationRemarkOther
|
||||
|
@ -1351,30 +1335,11 @@ extern "C" LLVMTypeKind LLVMRustGetTypeKind(LLVMTypeRef Ty) {
|
|||
|
||||
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(SMDiagnostic, LLVMSMDiagnosticRef)
|
||||
|
||||
#if LLVM_VERSION_LT(13, 0)
|
||||
using LLVMInlineAsmDiagHandlerTy = LLVMContext::InlineAsmDiagHandlerTy;
|
||||
#else
|
||||
using LLVMInlineAsmDiagHandlerTy = void*;
|
||||
#endif
|
||||
|
||||
extern "C" void LLVMRustSetInlineAsmDiagnosticHandler(
|
||||
LLVMContextRef C, LLVMInlineAsmDiagHandlerTy H, void *CX) {
|
||||
// Diagnostic handlers were unified in LLVM change 5de2d189e6ad, so starting
|
||||
// with LLVM 13 this function is gone.
|
||||
#if LLVM_VERSION_LT(13, 0)
|
||||
unwrap(C)->setInlineAsmDiagnosticHandler(H, CX);
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" LLVMSMDiagnosticRef LLVMRustGetSMDiagnostic(
|
||||
LLVMDiagnosticInfoRef DI, unsigned *Cookie) {
|
||||
#if LLVM_VERSION_GE(13, 0)
|
||||
llvm::DiagnosticInfoSrcMgr *SM = static_cast<llvm::DiagnosticInfoSrcMgr *>(unwrap(DI));
|
||||
*Cookie = SM->getLocCookie();
|
||||
return wrap(&SM->getSMDiag());
|
||||
#else
|
||||
report_fatal_error("Shouldn't get called on older versions");
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" bool LLVMRustUnpackSMDiagnostic(LLVMSMDiagnosticRef DRef,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue