Skip to content

Commit d31b6fb

Browse files
committed
Auto merge of rust-lang#122690 - matthiaskrgr:rollup-43fggl0, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#122480 (Avoid various uses of `Option<Span>` in favor of using `DUMMY_SP` in the few cases that used `None`) - rust-lang#122567 (Remove fixme about LLVM basic block naming) - rust-lang#122588 (less useless filter calls in imported_source_file) - rust-lang#122647 (add_retag: ensure box-to-raw-ptr casts are preserved for Miri) - rust-lang#122649 (Update the minimum external LLVM to 17) - rust-lang#122680 (Do not eat nested expressions' results in `MayContainYieldPoint` format args visitor) - rust-lang#122683 (add missing test: expected paren or brace in macro) - rust-lang#122689 (Add missing `try_visit` calls in visitors.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3cdcdaf + 9011e67 commit d31b6fb

File tree

75 files changed

+241
-365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+241
-365
lines changed

.github/workflows/ci.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: mingw-check-tidy
5959
os: ubuntu-20.04-4core-16gb
6060
env: {}
61-
- name: x86_64-gnu-llvm-16
61+
- name: x86_64-gnu-llvm-17
6262
env:
6363
ENABLE_GCC_CODEGEN: "1"
6464
os: ubuntu-20.04-16core-64gb
@@ -323,10 +323,6 @@ jobs:
323323
env:
324324
RUST_BACKTRACE: 1
325325
os: ubuntu-20.04-8core-32gb
326-
- name: x86_64-gnu-llvm-16
327-
env:
328-
RUST_BACKTRACE: 1
329-
os: ubuntu-20.04-8core-32gb
330326
- name: x86_64-gnu-nopt
331327
os: ubuntu-20.04-4core-16gb
332328
env: {}

compiler/rustc_ast/src/visit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ pub fn walk_assoc_item<'a, V: Visitor<'a>>(
755755
}
756756
AssocItemKind::Delegation(box Delegation { id, qself, path, body }) => {
757757
if let Some(qself) = qself {
758-
visitor.visit_ty(&qself.ty);
758+
try_visit!(visitor.visit_ty(&qself.ty));
759759
}
760760
try_visit!(visitor.visit_path(path, *id));
761761
visit_opt!(visitor, visit_block, body);
@@ -994,7 +994,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) -> V
994994
ExprKind::InlineAsm(asm) => try_visit!(visitor.visit_inline_asm(asm)),
995995
ExprKind::FormatArgs(f) => try_visit!(visitor.visit_format_args(f)),
996996
ExprKind::OffsetOf(container, fields) => {
997-
visitor.visit_ty(container);
997+
try_visit!(visitor.visit_ty(container));
998998
walk_list!(visitor, visit_ident, fields.iter().copied());
999999
}
10001000
ExprKind::Yield(optional_expression) => {

compiler/rustc_ast_lowering/src/format.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,7 @@ fn may_contain_yield_point(e: &ast::Expr) -> bool {
604604
if let ast::ExprKind::Await(_, _) | ast::ExprKind::Yield(_) = e.kind {
605605
ControlFlow::Break(())
606606
} else {
607-
visit::walk_expr(self, e);
608-
ControlFlow::Continue(())
607+
visit::walk_expr(self, e)
609608
}
610609
}
611610

compiler/rustc_codegen_cranelift/src/constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
7474
let cv = fx.monomorphize(constant.const_);
7575
// This cannot fail because we checked all required_consts in advance.
7676
let val = cv
77-
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(constant.span))
77+
.eval(fx.tcx, ty::ParamEnv::reveal_all(), constant.span)
7878
.expect("erroneous constant missed by mono item collection");
7979
(val, cv.ty())
8080
}

compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,10 @@ fn codegen_regular_intrinsic_call<'tcx>(
728728
| sym::variant_count => {
729729
intrinsic_args!(fx, args => (); intrinsic);
730730

731-
let const_val =
732-
fx.tcx.const_eval_instance(ParamEnv::reveal_all(), instance, None).unwrap();
731+
let const_val = fx
732+
.tcx
733+
.const_eval_instance(ParamEnv::reveal_all(), instance, source_info.span)
734+
.unwrap();
733735
let val = crate::constant::codegen_const_value(fx, const_val, ret.layout().ty);
734736
ret.write_cvalue(fx, val);
735737
}

compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
131131

132132
let idx = generic_args[2]
133133
.expect_const()
134-
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(span))
134+
.eval(fx.tcx, ty::ParamEnv::reveal_all(), span)
135135
.unwrap()
136136
.unwrap_branch();
137137

compiler/rustc_codegen_llvm/src/context.rs

-11
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,6 @@ pub unsafe fn create_module<'ll>(
126126

127127
let mut target_data_layout = sess.target.data_layout.to_string();
128128
let llvm_version = llvm_util::get_version();
129-
if llvm_version < (17, 0, 0) {
130-
if sess.target.arch.starts_with("powerpc") {
131-
// LLVM 17 specifies function pointer alignment for ppc:
132-
// https://reviews.llvm.org/D147016
133-
target_data_layout = target_data_layout
134-
.replace("-Fn32", "")
135-
.replace("-Fi32", "")
136-
.replace("-Fn64", "")
137-
.replace("-Fi64", "");
138-
}
139-
}
140129
if llvm_version < (18, 0, 0) {
141130
if sess.target.arch == "x86" || sess.target.arch == "x86_64" {
142131
// LLVM 18 adjusts i128 to be 128-bit aligned on x86 variants.

compiler/rustc_codegen_llvm/src/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
11291129
if name == sym::simd_shuffle_generic {
11301130
let idx = fn_args[2]
11311131
.expect_const()
1132-
.eval(tcx, ty::ParamEnv::reveal_all(), Some(span))
1132+
.eval(tcx, ty::ParamEnv::reveal_all(), span)
11331133
.unwrap()
11341134
.unwrap_branch();
11351135
let n = idx.len() as u64;

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use rustc_hir::{CoroutineDesugaring, CoroutineKind, CoroutineSource, Mutability}
1919
use rustc_middle::ty::layout::{IntegerExt, TyAndLayout};
2020
use rustc_middle::ty::{self, ExistentialProjection, ParamEnv, Ty, TyCtxt};
2121
use rustc_middle::ty::{GenericArgKind, GenericArgsRef};
22+
use rustc_span::DUMMY_SP;
2223
use rustc_target::abi::Integer;
2324
use smallvec::SmallVec;
2425

@@ -704,7 +705,7 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
704705
// avoiding collisions and will make the emitted type names shorter.
705706
let hash_short = tcx.with_stable_hashing_context(|mut hcx| {
706707
let mut hasher = StableHasher::new();
707-
let ct = ct.eval(tcx, ty::ParamEnv::reveal_all(), None).unwrap();
708+
let ct = ct.eval(tcx, ty::ParamEnv::reveal_all(), DUMMY_SP).unwrap();
708709
hcx.while_hashing_spans(false, |hcx| ct.hash_stable(hcx, &mut hasher));
709710
hasher.finish::<Hash64>()
710711
});

compiler/rustc_codegen_ssa/src/mir/block.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
16881688
pub fn try_llbb(&mut self, bb: mir::BasicBlock) -> Option<Bx::BasicBlock> {
16891689
match self.cached_llbbs[bb] {
16901690
CachedLlbb::None => {
1691-
// FIXME(eddyb) only name the block if `fewer_names` is `false`.
16921691
let llbb = Bx::append_block(self.cx, self.llfn, &format!("{bb:?}"));
16931692
self.cached_llbbs[bb] = CachedLlbb::Some(llbb);
16941693
Some(llbb)

compiler/rustc_codegen_ssa/src/mir/constant.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
2424
// `MirUsedCollector` visited all required_consts before codegen began, so if we got here
2525
// there can be no more constants that fail to evaluate.
2626
self.monomorphize(constant.const_)
27-
.eval(self.cx.tcx(), ty::ParamEnv::reveal_all(), Some(constant.span))
27+
.eval(self.cx.tcx(), ty::ParamEnv::reveal_all(), constant.span)
2828
.expect("erroneous constant missed by mono item collection")
2929
}
3030

@@ -56,11 +56,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
5656
other => span_bug!(constant.span, "{other:#?}"),
5757
};
5858
let uv = self.monomorphize(uv);
59-
self.cx.tcx().const_eval_resolve_for_typeck(
60-
ty::ParamEnv::reveal_all(),
61-
uv,
62-
Some(constant.span),
63-
)
59+
self.cx.tcx().const_eval_resolve_for_typeck(ty::ParamEnv::reveal_all(), uv, constant.span)
6460
}
6561

6662
/// process constant containing SIMD shuffle indices

compiler/rustc_codegen_ssa/src/mir/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
130130
| sym::variant_count => {
131131
let value = bx
132132
.tcx()
133-
.const_eval_instance(ty::ParamEnv::reveal_all(), instance, None)
133+
.const_eval_instance(ty::ParamEnv::reveal_all(), instance, span)
134134
.unwrap();
135135
OperandRef::from_const(bx, value, ret_ty).immediate_or_packed_pair(bx)
136136
}

compiler/rustc_const_eval/src/interpret/eval_context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
826826
for &const_ in &body.required_consts {
827827
let c = self
828828
.instantiate_from_current_frame_and_normalize_erasing_regions(const_.const_)?;
829-
c.eval(*self.tcx, self.param_env, Some(const_.span)).map_err(|err| {
829+
c.eval(*self.tcx, self.param_env, const_.span).map_err(|err| {
830830
err.emit_note(*self.tcx);
831831
err
832832
})?;
@@ -1174,7 +1174,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
11741174
pub fn eval_mir_constant(
11751175
&self,
11761176
val: &mir::Const<'tcx>,
1177-
span: Option<Span>,
1177+
span: Span,
11781178
layout: Option<TyAndLayout<'tcx>>,
11791179
) -> InterpResult<'tcx, OpTy<'tcx, M::Provenance>> {
11801180
M::eval_mir_constant(self, *val, span, layout, |ecx, val, span, layout| {

compiler/rustc_const_eval/src/interpret/intrinsics.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
153153
sym::type_name => Ty::new_static_str(self.tcx.tcx),
154154
_ => bug!(),
155155
};
156-
let val = self.ctfe_query(|tcx| {
157-
tcx.const_eval_global_id(self.param_env, gid, Some(tcx.span))
158-
})?;
156+
let val =
157+
self.ctfe_query(|tcx| tcx.const_eval_global_id(self.param_env, gid, tcx.span))?;
159158
let val = self.const_val_to_op(val, ty, Some(dest.layout))?;
160159
self.copy_op(&val, dest)?;
161160
}

compiler/rustc_const_eval/src/interpret/machine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -525,15 +525,15 @@ pub trait Machine<'mir, 'tcx: 'mir>: Sized {
525525
fn eval_mir_constant<F>(
526526
ecx: &InterpCx<'mir, 'tcx, Self>,
527527
val: mir::Const<'tcx>,
528-
span: Option<Span>,
528+
span: Span,
529529
layout: Option<TyAndLayout<'tcx>>,
530530
eval: F,
531531
) -> InterpResult<'tcx, OpTy<'tcx, Self::Provenance>>
532532
where
533533
F: Fn(
534534
&InterpCx<'mir, 'tcx, Self>,
535535
mir::Const<'tcx>,
536-
Option<Span>,
536+
Span,
537537
Option<TyAndLayout<'tcx>>,
538538
) -> InterpResult<'tcx, OpTy<'tcx, Self::Provenance>>,
539539
{

compiler/rustc_const_eval/src/interpret/operand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
741741
// * During ConstProp, with `TooGeneric` or since the `required_consts` were not all
742742
// checked yet.
743743
// * During CTFE, since promoteds in `const`/`static` initializer bodies can fail.
744-
self.eval_mir_constant(&c, Some(constant.span), layout)?
744+
self.eval_mir_constant(&c, constant.span, layout)?
745745
}
746746
};
747747
trace!("{:?}: {:?}", mir_op, op);

compiler/rustc_const_eval/src/transform/validate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CfgChecker<'a, 'tcx> {
341341
// FIXME(JakobDegen) The validator should check that `self.mir_phase <
342342
// DropsLowered`. However, this causes ICEs with generation of drop shims, which
343343
// seem to fail to set their `MirPhase` correctly.
344-
if matches!(kind, RetagKind::Raw | RetagKind::TwoPhase) {
344+
if matches!(kind, RetagKind::TwoPhase) {
345345
self.fail(location, format!("explicit `{kind:?}` is forbidden"));
346346
}
347347
}
@@ -1272,7 +1272,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
12721272
// FIXME(JakobDegen) The validator should check that `self.mir_phase <
12731273
// DropsLowered`. However, this causes ICEs with generation of drop shims, which
12741274
// seem to fail to set their `MirPhase` correctly.
1275-
if matches!(kind, RetagKind::Raw | RetagKind::TwoPhase) {
1275+
if matches!(kind, RetagKind::TwoPhase) {
12761276
self.fail(location, format!("explicit `{kind:?}` is forbidden"));
12771277
}
12781278
}

compiler/rustc_hir/src/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ pub fn walk_generic_param<'v, V: Visitor<'v>>(
899899
GenericParamKind::Const { ref ty, ref default, is_host_effect: _ } => {
900900
try_visit!(visitor.visit_ty(ty));
901901
if let Some(ref default) = default {
902-
visitor.visit_const_param_default(param.hir_id, default);
902+
try_visit!(visitor.visit_const_param_default(param.hir_id, default));
903903
}
904904
}
905905
}

compiler/rustc_hir_analysis/src/check/intrinsic.rs

-4
Original file line numberDiff line numberDiff line change
@@ -658,10 +658,6 @@ pub fn check_intrinsic_type(
658658
sym::simd_shuffle => (3, 0, vec![param(0), param(0), param(1)], param(2)),
659659
sym::simd_shuffle_generic => (2, 1, vec![param(0), param(0)], param(1)),
660660

661-
sym::retag_box_to_raw => {
662-
(2, 0, vec![Ty::new_mut_ptr(tcx, param(0))], Ty::new_mut_ptr(tcx, param(0)))
663-
}
664-
665661
other => {
666662
tcx.dcx().emit_err(UnrecognizedIntrinsicFunction { span, name: other });
667663
return;

compiler/rustc_hir_typeck/src/pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
21782178
len: ty::Const<'tcx>,
21792179
min_len: u64,
21802180
) -> (Option<Ty<'tcx>>, Ty<'tcx>) {
2181-
let len = match len.eval(self.tcx, self.param_env, None) {
2181+
let len = match len.eval(self.tcx, self.param_env, span) {
21822182
Ok(val) => val
21832183
.try_to_scalar()
21842184
.and_then(|scalar| scalar.try_to_int().ok())

compiler/rustc_infer/src/infer/mod.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ impl<'tcx> InferCtxt<'tcx> {
14751475
param_env: ty::ParamEnv<'tcx>,
14761476
unevaluated: ty::UnevaluatedConst<'tcx>,
14771477
ty: Ty<'tcx>,
1478-
span: Option<Span>,
1478+
span: Span,
14791479
) -> Result<ty::Const<'tcx>, ErrorHandled> {
14801480
match self.const_eval_resolve(param_env, unevaluated, span) {
14811481
Ok(Some(val)) => Ok(ty::Const::new_value(self.tcx, val, ty)),
@@ -1509,7 +1509,7 @@ impl<'tcx> InferCtxt<'tcx> {
15091509
&self,
15101510
mut param_env: ty::ParamEnv<'tcx>,
15111511
unevaluated: ty::UnevaluatedConst<'tcx>,
1512-
span: Option<Span>,
1512+
span: Span,
15131513
) -> EvalToValTreeResult<'tcx> {
15141514
let mut args = self.resolve_vars_if_possible(unevaluated.args);
15151515
debug!(?args);
@@ -1521,12 +1521,9 @@ impl<'tcx> InferCtxt<'tcx> {
15211521
if let Some(ct) = tcx.thir_abstract_const(unevaluated.def)? {
15221522
let ct = tcx.expand_abstract_consts(ct.instantiate(tcx, args));
15231523
if let Err(e) = ct.error_reported() {
1524-
return Err(ErrorHandled::Reported(
1525-
e.into(),
1526-
span.unwrap_or(rustc_span::DUMMY_SP),
1527-
));
1524+
return Err(ErrorHandled::Reported(e.into(), span));
15281525
} else if ct.has_non_region_infer() || ct.has_non_region_param() {
1529-
return Err(ErrorHandled::TooGeneric(span.unwrap_or(rustc_span::DUMMY_SP)));
1526+
return Err(ErrorHandled::TooGeneric(span));
15301527
} else {
15311528
args = replace_param_and_infer_args_with_placeholder(tcx, args);
15321529
}

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+4-36
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
#include "llvm/Passes/StandardInstrumentations.h"
2525
#include "llvm/Support/CBindingWrapping.h"
2626
#include "llvm/Support/FileSystem.h"
27-
#if LLVM_VERSION_GE(17, 0)
2827
#include "llvm/Support/VirtualFileSystem.h"
29-
#endif
3028
#include "llvm/Target/TargetMachine.h"
3129
#include "llvm/Transforms/IPO/AlwaysInliner.h"
3230
#include "llvm/Transforms/IPO/FunctionImport.h"
@@ -334,14 +332,8 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM,
334332

335333
std::ostringstream Buf;
336334

337-
#if LLVM_VERSION_GE(17, 0)
338335
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
339336
const ArrayRef<SubtargetSubTypeKV> CPUTable = MCInfo->getAllProcessorDescriptions();
340-
#else
341-
Buf << "Full target CPU help is not supported by this LLVM version.\n\n";
342-
SubtargetSubTypeKV TargetCPUKV = { TargetCPU, {{}}, {{}} };
343-
const ArrayRef<SubtargetSubTypeKV> CPUTable = TargetCPUKV;
344-
#endif
345337
unsigned MaxCPULen = getLongestEntryLength(CPUTable);
346338

347339
Buf << "Available CPUs for this target:\n";
@@ -476,10 +468,6 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
476468
Options.RelaxELFRelocations = RelaxELFRelocations;
477469
#endif
478470
Options.UseInitArray = UseInitArray;
479-
480-
#if LLVM_VERSION_LT(17, 0)
481-
Options.ExplicitEmulatedTLS = true;
482-
#endif
483471
Options.EmulatedTLS = UseEmulatedTls;
484472

485473
if (TrapUnreachable) {
@@ -761,50 +749,32 @@ LLVMRustOptimize(
761749
}
762750

763751
std::optional<PGOOptions> PGOOpt;
764-
#if LLVM_VERSION_GE(17, 0)
765752
auto FS = vfs::getRealFileSystem();
766-
#endif
767753
if (PGOGenPath) {
768754
assert(!PGOUsePath && !PGOSampleUsePath);
769-
PGOOpt = PGOOptions(PGOGenPath, "", "",
770-
#if LLVM_VERSION_GE(17, 0)
771-
"",
772-
FS,
773-
#endif
755+
PGOOpt = PGOOptions(PGOGenPath, "", "", "", FS,
774756
PGOOptions::IRInstr, PGOOptions::NoCSAction,
775757
#if LLVM_VERSION_GE(19, 0)
776758
PGOOptions::ColdFuncOpt::Default,
777759
#endif
778760
DebugInfoForProfiling);
779761
} else if (PGOUsePath) {
780762
assert(!PGOSampleUsePath);
781-
PGOOpt = PGOOptions(PGOUsePath, "", "",
782-
#if LLVM_VERSION_GE(17, 0)
783-
"",
784-
FS,
785-
#endif
763+
PGOOpt = PGOOptions(PGOUsePath, "", "", "", FS,
786764
PGOOptions::IRUse, PGOOptions::NoCSAction,
787765
#if LLVM_VERSION_GE(19, 0)
788766
PGOOptions::ColdFuncOpt::Default,
789767
#endif
790768
DebugInfoForProfiling);
791769
} else if (PGOSampleUsePath) {
792-
PGOOpt = PGOOptions(PGOSampleUsePath, "", "",
793-
#if LLVM_VERSION_GE(17, 0)
794-
"",
795-
FS,
796-
#endif
770+
PGOOpt = PGOOptions(PGOSampleUsePath, "", "", "", FS,
797771
PGOOptions::SampleUse, PGOOptions::NoCSAction,
798772
#if LLVM_VERSION_GE(19, 0)
799773
PGOOptions::ColdFuncOpt::Default,
800774
#endif
801775
DebugInfoForProfiling);
802776
} else if (DebugInfoForProfiling) {
803-
PGOOpt = PGOOptions("", "", "",
804-
#if LLVM_VERSION_GE(17, 0)
805-
"",
806-
FS,
807-
#endif
777+
PGOOpt = PGOOptions("", "", "", "", FS,
808778
PGOOptions::NoAction, PGOOptions::NoCSAction,
809779
#if LLVM_VERSION_GE(19, 0)
810780
PGOOptions::ColdFuncOpt::Default,
@@ -1353,9 +1323,7 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
13531323
ComputeCrossModuleImport(
13541324
Ret->Index,
13551325
Ret->ModuleToDefinedGVSummaries,
1356-
#if LLVM_VERSION_GE(17, 0)
13571326
isPrevailing,
1358-
#endif
13591327
Ret->ImportLists,
13601328
Ret->ExportLists
13611329
);

0 commit comments

Comments
 (0)