Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d31b6fb

Browse files
committedMar 18, 2024
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
 

‎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
);
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.