Rollup merge of #131829 - Zalathar:goodbye-zprofile, r=chenyukang · ehuss/rust@526c67f (original) (raw)
`@@ -90,7 +90,6 @@ pub struct ModuleConfig {
`
90
90
`pub pgo_sample_use: Option,
`
91
91
`pub debug_info_for_profiling: bool,
`
92
92
`pub instrument_coverage: bool,
`
93
``
`-
pub instrument_gcov: bool,
`
94
93
``
95
94
`pub sanitizer: SanitizerSet,
`
96
95
`pub sanitizer_recover: SanitizerSet,
`
`@@ -123,12 +122,7 @@ pub struct ModuleConfig {
`
123
122
`}
`
124
123
``
125
124
`impl ModuleConfig {
`
126
``
`-
fn new(
`
127
``
`-
kind: ModuleKind,
`
128
``
`-
tcx: TyCtxt<'_>,
`
129
``
`-
no_builtins: bool,
`
130
``
`-
is_compiler_builtins: bool,
`
131
``
`-
) -> ModuleConfig {
`
``
125
`+
fn new(kind: ModuleKind, tcx: TyCtxt<'_>, no_builtins: bool) -> ModuleConfig {
`
132
126
`` // If it's a regular module, use $regular
, otherwise use $other
.
``
133
127
`` // $regular
and $other
are evaluated lazily.
``
134
128
`macro_rules! if_regular {
`
`@@ -189,13 +183,6 @@ impl ModuleConfig {
`
189
183
`pgo_sample_use: if_regular!(sess.opts.unstable_opts.profile_sample_use.clone(), None),
`
190
184
`debug_info_for_profiling: sess.opts.unstable_opts.debug_info_for_profiling,
`
191
185
`instrument_coverage: if_regular!(sess.instrument_coverage(), false),
`
192
``
`-
instrument_gcov: if_regular!(
`
193
``
`-
// compiler_builtins overrides the codegen-units settings,
`
194
``
`-
// which is incompatible with -Zprofile which requires that
`
195
``
`-
// only a single codegen unit is used per crate.
`
196
``
`-
sess.opts.unstable_opts.profile && !is_compiler_builtins,
`
197
``
`-
false
`
198
``
`-
),
`
199
186
``
200
187
`sanitizer: if_regular!(sess.opts.unstable_opts.sanitizer, SanitizerSet::empty()),
`
201
188
`sanitizer_dataflow_abilist: if_regular!(
`
`@@ -473,16 +460,12 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>(
`
473
460
``
474
461
`let crate_attrs = tcx.hir().attrs(rustc_hir::CRATE_HIR_ID);
`
475
462
`let no_builtins = attr::contains_name(crate_attrs, sym::no_builtins);
`
476
``
`-
let is_compiler_builtins = attr::contains_name(crate_attrs, sym::compiler_builtins);
`
477
463
``
478
464
`let crate_info = CrateInfo::new(tcx, target_cpu);
`
479
465
``
480
``
`-
let regular_config =
`
481
``
`-
ModuleConfig::new(ModuleKind::Regular, tcx, no_builtins, is_compiler_builtins);
`
482
``
`-
let metadata_config =
`
483
``
`-
ModuleConfig::new(ModuleKind::Metadata, tcx, no_builtins, is_compiler_builtins);
`
484
``
`-
let allocator_config =
`
485
``
`-
ModuleConfig::new(ModuleKind::Allocator, tcx, no_builtins, is_compiler_builtins);
`
``
466
`+
let regular_config = ModuleConfig::new(ModuleKind::Regular, tcx, no_builtins);
`
``
467
`+
let metadata_config = ModuleConfig::new(ModuleKind::Metadata, tcx, no_builtins);
`
``
468
`+
let allocator_config = ModuleConfig::new(ModuleKind::Allocator, tcx, no_builtins);
`
486
469
``
487
470
`let (shared_emitter, shared_emitter_main) = SharedEmitter::new();
`
488
471
`let (codegen_worker_send, codegen_worker_receive) = channel();
`