1
Fork 0

Auto merge of #85909 - cjgillot:alloc-kind-query, r=Aaron1011

Make allocator_kind a query.

Part of #85153

r? `@Aaron1011`
This commit is contained in:
bors 2021-06-28 01:20:01 +00:00
commit 345530412f
10 changed files with 11 additions and 17 deletions

View file

@ -180,7 +180,7 @@ fn exported_symbols_provider_local(
symbols.push((exported_symbol, SymbolExportLevel::C));
}
if tcx.allocator_kind().is_some() {
if tcx.allocator_kind(()).is_some() {
for method in ALLOCATOR_METHODS {
let symbol_name = format!("__rust_{}", method.name);
let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, &symbol_name));

View file

@ -518,7 +518,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
});
let allocator_module = if any_dynamic_crate {
None
} else if let Some(kind) = tcx.allocator_kind() {
} else if let Some(kind) = tcx.allocator_kind(()) {
let llmod_id =
cgu_name_builder.build_cgu_name(LOCAL_CRATE, &["crate"], Some("allocator")).to_string();
let mut modules = backend.new_metadata(tcx, &llmod_id);