Skip to content

Commit b394066

Browse files
committed
update the backend, cg_ssa and cg_llvm
1 parent f253e67 commit b394066

File tree

12 files changed

+464
-19
lines changed

12 files changed

+464
-19
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,6 +4261,7 @@ dependencies = [
42614261
name = "rustc_monomorphize"
42624262
version = "0.0.0"
42634263
dependencies = [
4264+
"rustc_ast",
42644265
"rustc_data_structures",
42654266
"rustc_errors",
42664267
"rustc_fluent_macro",
@@ -4269,6 +4270,7 @@ dependencies = [
42694270
"rustc_middle",
42704271
"rustc_session",
42714272
"rustc_span",
4273+
"rustc_symbol_mangling",
42724274
"rustc_target",
42734275
"serde",
42744276
"serde_json",

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ pub fn from_fn_attrs<'ll, 'tcx>(
294294
instance: ty::Instance<'tcx>,
295295
) {
296296
let codegen_fn_attrs = cx.tcx.codegen_fn_attrs(instance.def_id());
297+
let autodiff_attrs = cx.tcx.autodiff_attrs(instance.def_id());
297298

298299
let mut to_add = SmallVec::<[_; 16]>::new();
299300

@@ -311,6 +312,8 @@ pub fn from_fn_attrs<'ll, 'tcx>(
311312
let inline =
312313
if codegen_fn_attrs.inline == InlineAttr::None && instance.def.requires_inline(cx.tcx) {
313314
InlineAttr::Hint
315+
} else if autodiff_attrs.is_active() {
316+
InlineAttr::Never
314317
} else {
315318
codegen_fn_attrs.inline
316319
};

compiler/rustc_codegen_llvm/src/back/lto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ pub unsafe fn optimize_thin_module(
714714
let llcx = llvm::LLVMRustContextCreate(cgcx.fewer_names);
715715
let llmod_raw = parse_module(llcx, module_name, thin_module.data(), &dcx)? as *const _;
716716
let mut module = ModuleCodegen {
717-
module_llvm: ModuleLlvm { llmod_raw, llcx, tm: ManuallyDrop::new(tm) },
717+
module_llvm: ModuleLlvm { llmod_raw, llcx, tm: ManuallyDrop::new(tm), typetrees: Default::default() },
718718
name: thin_module.name().to_string(),
719719
kind: ModuleKind::Regular,
720720
};

0 commit comments

Comments
 (0)