Skip to content

Commit b630029

Browse files
committed
Make LLVMRustInlineAsmVerify take *const c_uchar
This avoids the need for an explicit `as_c_char_ptr` conversion.
1 parent b1094f6 commit b630029

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

compiler/rustc_codegen_llvm/src/asm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use smallvec::SmallVec;
1414
use tracing::debug;
1515

1616
use crate::builder::Builder;
17-
use crate::common::{AsCCharPtr, Funclet};
17+
use crate::common::Funclet;
1818
use crate::context::CodegenCx;
1919
use crate::type_::Type;
2020
use crate::type_of::LayoutLlvmExt;
@@ -477,8 +477,7 @@ pub(crate) fn inline_asm_call<'ll>(
477477
debug!("Asm Output Type: {:?}", output);
478478
let fty = bx.cx.type_func(&argtys, output);
479479
// Ask LLVM to verify that the constraints are well-formed.
480-
let constraints_ok =
481-
unsafe { llvm::LLVMRustInlineAsmVerify(fty, cons.as_c_char_ptr(), cons.len()) };
480+
let constraints_ok = unsafe { llvm::LLVMRustInlineAsmVerify(fty, cons.as_ptr(), cons.len()) };
482481
debug!("constraint verification result: {:?}", constraints_ok);
483482
if constraints_ok {
484483
let v = unsafe {

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2013,7 +2013,7 @@ unsafe extern "C" {
20132013

20142014
pub(crate) fn LLVMRustInlineAsmVerify(
20152015
Ty: &Type,
2016-
Constraints: *const c_char,
2016+
Constraints: *const c_uchar, // See "PTR_LEN_STR".
20172017
ConstraintsLen: size_t,
20182018
) -> bool;
20192019

0 commit comments

Comments
 (0)