@@ -28,6 +28,7 @@ use rustc_codegen_ssa::base::to_immediate;
2828use rustc_codegen_ssa:: mir:: operand:: { OperandValue , OperandRef } ;
2929use rustc_codegen_ssa:: mir:: place:: PlaceRef ;
3030use std:: borrow:: Cow ;
31+ use std:: ffi:: CStr ;
3132use std:: ops:: Range ;
3233use std:: ptr;
3334
@@ -838,7 +839,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
838839 }
839840 }
840841
841- fn inline_asm_call ( & mut self , asm : * const c_char , cons : * const c_char ,
842+ fn inline_asm_call ( & mut self , asm : & CStr , cons : & CStr ,
842843 inputs : & [ & ' ll Value ] , output : & ' ll Type ,
843844 volatile : bool , alignstack : bool ,
844845 dia : syntax:: ast:: AsmDialect ) -> Option < & ' ll Value > {
@@ -858,11 +859,17 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
858859 let fty = self . cx ( ) . type_func ( & argtys[ ..] , output) ;
859860 unsafe {
860861 // Ask LLVM to verify that the constraints are well-formed.
861- let constraints_ok = llvm:: LLVMRustInlineAsmVerify ( fty, cons) ;
862+ let constraints_ok = llvm:: LLVMRustInlineAsmVerify ( fty, cons. as_ptr ( ) ) ;
862863 debug ! ( "Constraint verification result: {:?}" , constraints_ok) ;
863864 if constraints_ok {
864865 let v = llvm:: LLVMRustInlineAsm (
865- fty, asm, cons, volatile, alignstack, AsmDialect :: from_generic ( dia) ) ;
866+ fty,
867+ asm. as_ptr ( ) ,
868+ cons. as_ptr ( ) ,
869+ volatile,
870+ alignstack,
871+ AsmDialect :: from_generic ( dia) ,
872+ ) ;
866873 Some ( self . call ( v, inputs, None ) )
867874 } else {
868875 // LLVM has detected an issue with our constraints, bail out
@@ -1400,10 +1407,8 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
14001407 self . cx
14011408 }
14021409
1403- fn delete_basic_block ( & mut self , bb : & ' ll BasicBlock ) {
1404- unsafe {
1405- llvm:: LLVMDeleteBasicBlock ( bb) ;
1406- }
1410+ unsafe fn delete_basic_block ( & mut self , bb : & ' ll BasicBlock ) {
1411+ llvm:: LLVMDeleteBasicBlock ( bb) ;
14071412 }
14081413
14091414 fn do_not_inline ( & mut self , llret : & ' ll Value ) {
0 commit comments