Skip to content

Commit d302801

Browse files
committed
fix
1 parent e005385 commit d302801

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pub(crate) fn add_unnamed_global<'ll>(
164164
l: Linkage,
165165
) -> &'ll llvm::Value {
166166
let llglobal = add_global(cx, name, initializer, l);
167-
llvm::SetUnnamedAddress(llglobal, llvm::UnnamedAddr::Global);
167+
llvm::LLVMSetUnnamedAddress(llglobal, llvm::UnnamedAddr::Global);
168168
llglobal
169169
}
170170

@@ -337,7 +337,7 @@ fn gen_call_handling<'ll>(
337337
// get function arg, store it into the alloca, and read it.
338338
let p = llvm::get_param(called, index as u32);
339339
let name = llvm::get_value_name(p);
340-
let name = str::from_utf8(name).unwrap();
340+
let name = str::from_utf8(&name).unwrap();
341341
let arg_name = format!("{name}.addr");
342342
let alloca = builder.direct_alloca(in_ty, Align::EIGHT, &arg_name);
343343

compiler/rustc_session/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2730,6 +2730,7 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
27302730
if !unstable_options_enabled {
27312731
if let Err(error) = cg.link_self_contained.check_unstable_variants(&target_triple) {
27322732
early_dcx.early_fatal(error);
2733+
}
27332734

27342735
if let Some(flavor) = cg.linker_flavor {
27352736
if flavor.is_unstable() {

tests/codegen/gpu_offload/gpu_host.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Zoffload=Enable -C opt-level=3 -Clto=fat
1+
//@ compile-flags: -Zoffload=Enable -Zunstable-options -C opt-level=3 -Clto=fat
22
//@ no-prefer-dynamic
33
//@ needs-enzyme
44

0 commit comments

Comments
 (0)