mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Flatten control-flow in inline_asm_call
after verification
This commit is contained in:
parent
b6300294a8
commit
eccf0647d3
@ -476,10 +476,15 @@ pub(crate) fn inline_asm_call<'ll>(
|
||||
|
||||
debug!("Asm Output Type: {:?}", output);
|
||||
let fty = bx.cx.type_func(&argtys, output);
|
||||
|
||||
// Ask LLVM to verify that the constraints are well-formed.
|
||||
let constraints_ok = unsafe { llvm::LLVMRustInlineAsmVerify(fty, cons.as_ptr(), cons.len()) };
|
||||
debug!("constraint verification result: {:?}", constraints_ok);
|
||||
if constraints_ok {
|
||||
if !constraints_ok {
|
||||
// LLVM has detected an issue with our constraints, so bail out.
|
||||
return None;
|
||||
}
|
||||
|
||||
let v = unsafe {
|
||||
llvm::LLVMGetInlineAsm(
|
||||
fty,
|
||||
@ -532,10 +537,6 @@ pub(crate) fn inline_asm_call<'ll>(
|
||||
llvm::LLVMSetMetadata(call, kind, md);
|
||||
|
||||
Some(call)
|
||||
} else {
|
||||
// LLVM has detected an issue with our constraints, bail out
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// If the register is an xmm/ymm/zmm register then return its index.
|
||||
|
Loading…
Reference in New Issue
Block a user