Use global_fn_name instead of format!
This commit is contained in:
parent
c50427ba86
commit
2be697f60d
1 changed files with 3 additions and 2 deletions
|
@ -2,7 +2,8 @@
|
||||||
use gccjit::FnAttribute;
|
use gccjit::FnAttribute;
|
||||||
use gccjit::{FunctionType, GlobalKind, ToRValue};
|
use gccjit::{FunctionType, GlobalKind, ToRValue};
|
||||||
use rustc_ast::expand::allocator::{
|
use rustc_ast::expand::allocator::{
|
||||||
alloc_error_handler_name, default_fn_name, AllocatorKind, AllocatorTy, ALLOCATOR_METHODS,
|
alloc_error_handler_name, default_fn_name, global_fn_name, AllocatorKind, AllocatorTy,
|
||||||
|
ALLOCATOR_METHODS,
|
||||||
};
|
};
|
||||||
use rustc_middle::bug;
|
use rustc_middle::bug;
|
||||||
use rustc_middle::ty::TyCtxt;
|
use rustc_middle::ty::TyCtxt;
|
||||||
|
@ -46,7 +47,7 @@ pub(crate) unsafe fn codegen(tcx: TyCtxt<'_>, mods: &mut GccContext, _module_nam
|
||||||
panic!("invalid allocator output")
|
panic!("invalid allocator output")
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let name = format!("__rust_{}", method.name);
|
let name = global_fn_name(method.name);
|
||||||
|
|
||||||
let args: Vec<_> = types.iter().enumerate()
|
let args: Vec<_> = types.iter().enumerate()
|
||||||
.map(|(index, typ)| context.new_parameter(None, *typ, &format!("param{}", index)))
|
.map(|(index, typ)| context.new_parameter(None, *typ, &format!("param{}", index)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue