Skip to content

Commit 4a2f7c7

Browse files
committed
Adapt to latest rustc master changes
1 parent a03673c commit 4a2f7c7

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/librustc_codegen_llvm/asm.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl AsmBuilderMethods<'a, 'll, 'tcx> for Builder<'a, 'll, 'tcx, &'ll Value> {
5757

5858
// Default per-arch clobbers
5959
// Basically what clang does
60-
let arch_clobbers = match &bx.sess().target.target.arch[..] {
60+
let arch_clobbers = match &self.cx().sess().target.target.arch[..] {
6161
"x86" | "x86_64" => vec!["~{dirflag}", "~{fpsr}", "~{flags}"],
6262
"mips" | "mips64" => vec!["~{$1}"],
6363
_ => Vec::new()
@@ -76,14 +76,14 @@ impl AsmBuilderMethods<'a, 'll, 'tcx> for Builder<'a, 'll, 'tcx, &'ll Value> {
7676
// Depending on how many outputs we have, the return type is different
7777
let num_outputs = output_types.len();
7878
let output_type = match num_outputs {
79-
0 => bx.cx().type_void(),
79+
0 => self.cx().type_void(),
8080
1 => output_types[0],
81-
_ => bx.cx().type_struct(&output_types, false)
81+
_ => self.cx().type_struct(&output_types, false)
8282
};
8383

8484
let asm = CString::new(ia.asm.as_str().as_bytes()).unwrap();
8585
let constraint_cstr = CString::new(all_constraints).unwrap();
86-
let r = bx.inline_asm_call(
86+
let r = self.inline_asm_call(
8787
asm.as_ptr(),
8888
constraint_cstr.as_ptr(),
8989
&inputs,
@@ -100,8 +100,8 @@ impl AsmBuilderMethods<'a, 'll, 'tcx> for Builder<'a, 'll, 'tcx, &'ll Value> {
100100
// Again, based on how many outputs we have
101101
let outputs = ia.outputs.iter().zip(&outputs).filter(|&(ref o, _)| !o.is_indirect);
102102
for (i, (_, &place)) in outputs.enumerate() {
103-
let v = if num_outputs == 1 { r } else { bx.extract_value(r, i as u64) };
104-
OperandValue::Immediate(v).store(bx, place);
103+
let v = if num_outputs == 1 { r } else { self.extract_value(r, i as u64) };
104+
OperandValue::Immediate(v).store(self, place);
105105
}
106106

107107
// Store mark in a metadata node so we can map LLVM errors
@@ -116,9 +116,9 @@ impl AsmBuilderMethods<'a, 'll, 'tcx> for Builder<'a, 'll, 'tcx, &'ll Value> {
116116
llvm::LLVMSetMetadata(r, kind,
117117
llvm::LLVMMDNodeInContext(self.cx().llcx, &val, 1));
118118
}
119-
}
120119

121120
return true;
121+
}
122122
}
123123

124124
impl AsmMethods for CodegenCx<'ll, 'tcx, &'ll Value> {

src/librustc_codegen_llvm/interfaces/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub trait AsmBuilderMethods<'a, 'll: 'a, 'tcx: 'll> : HasCodegen<'a, 'll, 'tcx>{
2020
ia: &InlineAsm,
2121
outputs: Vec<PlaceRef<'tcx, <Self::CodegenCx as Backend<'ll>>::Value>>,
2222
inputs: Vec<<Self::CodegenCx as Backend<'ll>>::Value>
23-
);
23+
) -> bool;
2424
}
2525

2626
pub trait AsmMethods {

src/librustc_codegen_llvm/interfaces/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ pub trait BuilderMethods<'a, 'll :'a, 'tcx: 'll> : HasCodegen<'a, 'll, 'tcx> +
386386
volatile: bool,
387387
alignstack: bool,
388388
dia: AsmDialect
389-
) -> <Self::CodegenCx as Backend<'ll>>::Value;
389+
) -> Option<<Self::CodegenCx as Backend<'ll>>::Value>;
390390

391391
fn minnum(
392392
&self,

src/librustc_codegen_llvm/mir/statement.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ impl<'a, 'f, 'll: 'a + 'f, 'tcx: 'll, Cx: CodegenMethods<'ll, 'tcx>>
100100
});
101101

102102
if input_vals.is_err() {
103-
span_err!(bx.cx.sess(), statement.source_info.span, E0669,
103+
span_err!(bx.cx().sess(), statement.source_info.span, E0669,
104104
"invalid value for constraint in inline assembly");
105105
} else {
106106
let input_vals = input_vals.unwrap();
107-
let res = asm::codegen_inline_asm(&bx, asm, outputs, input_vals);
107+
let res = xb.codegen_inline_asm(asm, outputs, input_vals);
108108
if !res {
109-
span_err!(bx.cx.sess(), statement.source_info.span, E0668,
109+
span_err!(bx.cx().sess(), statement.source_info.span, E0668,
110110
"malformed inline assembly");
111111
}
112112
}

0 commit comments

Comments
 (0)