Skip to content

Commit c0059c3

Browse files
committed
Feat: update nightly to 2021-12-04 in anticipation for 0.2
1 parent 93d9057 commit c0059c3

File tree

10 files changed

+103
-180
lines changed

10 files changed

+103
-180
lines changed

crates/cuda_std/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@
2424
#![cfg_attr(
2525
target_os = "cuda",
2626
no_std,
27-
feature(register_attr, alloc_error_handler, asm, link_llvm_intrinsics),
27+
feature(
28+
register_attr,
29+
alloc_error_handler,
30+
asm,
31+
asm_experimental_arch,
32+
link_llvm_intrinsics
33+
),
2834
register_attr(nvvm_internal)
2935
)]
3036

crates/rustc_codegen_nvvm/src/abi.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,7 @@ impl LlvmType for CastTarget {
220220
let mut args: Vec<_> = self
221221
.prefix
222222
.iter()
223-
.flat_map(|option_kind| {
224-
option_kind.map(|kind| {
225-
Reg {
226-
kind,
227-
size: self.prefix_chunk_size,
228-
}
229-
.llvm_type(cx)
230-
})
231-
})
223+
.flat_map(|option_reg| option_reg.map(|reg| reg.llvm_type(cx)))
232224
.chain((0..rest_count).map(|_| rest_ll_unit))
233225
.collect();
234226

@@ -538,16 +530,18 @@ impl<'a, 'll, 'tcx> AbiBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
538530
fn_abi.apply_attrs_callsite(self, callsite)
539531
}
540532

541-
fn get_param(&self, index: usize) -> Self::Value {
533+
fn get_param(&mut self, index: usize) -> Self::Value {
542534
let val = llvm::get_param(self.llfn(), index as c_uint);
543535
trace!("Get param `{:?}`", val);
544536
unsafe {
545537
let llfnty = LLVMRustGetFunctionType(self.llfn());
546-
let map = self.remapped_integer_args.borrow();
538+
// destructure so rustc doesnt complain in the call to transmute_llval
539+
let Self { cx, llbuilder } = self;
540+
let map = cx.remapped_integer_args.borrow();
547541
if let Some((_, key)) = map.get(llfnty) {
548542
if let Some((_, new_ty)) = key.iter().find(|t| t.0 == index) {
549543
trace!("Casting irregular param {:?} to {:?}", val, new_ty);
550-
return transmute_llval(*self.llbuilder.lock().unwrap(), self.cx, val, *new_ty);
544+
return transmute_llval(llbuilder, cx, val, *new_ty);
551545
}
552546
}
553547
val

crates/rustc_codegen_nvvm/src/asm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_codegen_ssa::{
1414
};
1515
use rustc_hash::FxHashMap;
1616
use rustc_hir::LlvmInlineAsmInner;
17-
use rustc_middle::span_bug;
17+
use rustc_middle::{span_bug, ty::Instance};
1818
use rustc_span::{Pos, Span};
1919
use rustc_target::asm::{InlineAsmRegClass, InlineAsmRegOrRegClass, NvptxInlineAsmRegClass};
2020

@@ -118,6 +118,7 @@ impl<'a, 'll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
118118
operands: &[InlineAsmOperandRef<'tcx, Self>],
119119
options: rustc_ast::InlineAsmOptions,
120120
line_spans: &[Span],
121+
_inst: Instance,
121122
) {
122123
// Collect the types of output operands
123124
let mut constraints = vec![];

crates/rustc_codegen_nvvm/src/back.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'_>, cgu_name: Symbol) -> (ModuleCodegen
246246
tcx,
247247
cgu_name,
248248
module_codegen,
249-
dep_graph::hash_result,
249+
Some(dep_graph::hash_result),
250250
);
251251

252252
fn module_codegen(tcx: TyCtxt<'_>, cgu_name: Symbol) -> ModuleCodegen<LlvmMod> {

0 commit comments

Comments
 (0)