Skip to content

Commit 491dd1f

Browse files
committed
Adjust llvm wrapper for unwinding support for inlineasm
1 parent 940b2ea commit 491dd1f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

compiler/rustc_codegen_llvm/src/asm.rs

+2
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ pub(crate) fn inline_asm_call(
450450
) -> Option<&'ll Value> {
451451
let volatile = if volatile { llvm::True } else { llvm::False };
452452
let alignstack = if alignstack { llvm::True } else { llvm::False };
453+
let can_throw = llvm::False;
453454

454455
let argtys = inputs
455456
.iter()
@@ -475,6 +476,7 @@ pub(crate) fn inline_asm_call(
475476
volatile,
476477
alignstack,
477478
llvm::AsmDialect::from_generic(dia),
479+
can_throw,
478480
);
479481
let call = bx.call(fty, v, inputs, None);
480482

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1847,6 +1847,7 @@ extern "C" {
18471847
SideEffects: Bool,
18481848
AlignStack: Bool,
18491849
Dialect: AsmDialect,
1850+
CanThrow: Bool,
18501851
) -> &Value;
18511852
pub fn LLVMRustInlineAsmVerify(
18521853
Ty: &Type,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,12 @@ extern "C" LLVMValueRef
445445
LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen,
446446
char *Constraints, size_t ConstraintsLen,
447447
LLVMBool HasSideEffects, LLVMBool IsAlignStack,
448-
LLVMRustAsmDialect Dialect) {
448+
LLVMRustAsmDialect Dialect, LLVMBool CanThrow) {
449449
return wrap(InlineAsm::get(unwrap<FunctionType>(Ty),
450450
StringRef(AsmString, AsmStringLen),
451451
StringRef(Constraints, ConstraintsLen),
452-
HasSideEffects, IsAlignStack, fromRust(Dialect)));
452+
HasSideEffects, IsAlignStack,
453+
fromRust(Dialect), CanThrow));
453454
}
454455

455456
extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,

0 commit comments

Comments
 (0)