Skip to content

Commit 9c9aac0

Browse files
committed
Iterate over params and minor fixes
1 parent 68a7a9f commit 9c9aac0

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,7 @@ pub(crate) fn gen_call_handling<'ll>(
390390
let mut vals = vec![];
391391
let mut geps = vec![];
392392
let i32_0 = cx.get_const_i32(0);
393-
for index in 0..num_args {
394-
let v = args[index as usize];
393+
for &v in args {
395394
let gep = builder.inbounds_gep(cx.type_f32(), v, &[i32_0]);
396395
vals.push(v);
397396
geps.push(gep);

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
199199
return Ok(());
200200
}
201201
sym::offload => {
202-
// FIXME(Sa4dUs): emit error when offload is not enabled
202+
// TODO(Sa4dUs): emit error when offload is not enabled
203203
codegen_offload(self, tcx, instance, args);
204204
return Ok(());
205205
}

compiler/rustc_middle/src/ty/offload_meta.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,8 @@ impl MappingFlags {
8686
| ty::Adt(_, _)
8787
| ty::Tuple(_)
8888
| ty::Array(_, _)
89-
| ty::FnDef(_, _)
90-
| ty::FnPtr(_, _)
91-
| ty::Closure(_, _)
92-
| ty::CoroutineClosure(_, _)
93-
| ty::Coroutine(_, _)
94-
| ty::CoroutineWitness(_, _)
95-
| ty::Never
9689
| ty::Alias(_, _)
97-
| ty::Param(_)
98-
| ty::Bound(_, _)
99-
| ty::Placeholder(_)
100-
| ty::Infer(_)
101-
| ty::Error(_) => MappingFlags::TO,
90+
| ty::Param(_) => MappingFlags::TO,
10291

10392
ty::RawPtr(_, Not) | ty::Ref(_, _, Not) => MappingFlags::TO,
10493

@@ -109,6 +98,18 @@ impl MappingFlags {
10998
ty::Foreign(_) | ty::Pat(_, _) | ty::UnsafeBinder(_) => {
11099
MappingFlags::TO | MappingFlags::FROM
111100
}
101+
102+
ty::FnDef(_, _)
103+
| ty::FnPtr(_, _)
104+
| ty::Closure(_, _)
105+
| ty::CoroutineClosure(_, _)
106+
| ty::Coroutine(_, _)
107+
| ty::CoroutineWitness(_, _)
108+
| ty::Never
109+
| ty::Bound(_, _)
110+
| ty::Placeholder(_)
111+
| ty::Infer(_)
112+
| ty::Error(_) => MappingFlags::TO, /* TODO(Sa4dUs): emit error */
112113
}
113114
}
114115
}

0 commit comments

Comments
 (0)