Skip to content

Commit 52a163f

Browse files
authored
Merge pull request swiftlang#84555 from gottesmm/pr-4f37ab5228b75850c247af4f8dd913996a0390bd
[irgen] Make HasAArch64TBI an IRGen option instead of a LangOpts.
2 parents bb362b0 + 361e63c commit 52a163f

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

include/swift/AST/IRGenOptions.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,9 @@ class IRGenOptions {
605605
/// Paths to the pass plugins registered via -load-pass-plugin.
606606
std::vector<std::string> LLVMPassPlugins;
607607

608+
/// Set to true if we support AArch64TBI.
609+
bool HasAArch64TBI = false;
610+
608611
IRGenOptions()
609612
: OutputKind(IRGenOutputKind::LLVMAssemblyAfterOptimization),
610613
Verify(true), VerifyEach(false), OptMode(OptimizationMode::NotSet),
@@ -641,22 +644,20 @@ class IRGenOptions {
641644
DisableStandardSubstitutionsInReflectionMangling(false),
642645
EnableGlobalISel(false), VirtualFunctionElimination(false),
643646
WitnessMethodElimination(false), ConditionalRuntimeRecords(false),
644-
AnnotateCondFailMessage(false),
645-
InternalizeAtLink(false), InternalizeSymbols(false),
646-
EmitGenericRODatas(true),
647+
AnnotateCondFailMessage(false), InternalizeAtLink(false),
648+
InternalizeSymbols(false), EmitGenericRODatas(true),
647649
NoPreallocatedInstantiationCaches(false),
648650
DisableReadonlyStaticObjects(false), CollocatedMetadataFunctions(false),
649651
ColocateTypeDescriptors(true), UseRelativeProtocolWitnessTables(false),
650652
UseFragileResilientProtocolWitnesses(false), EnableHotColdSplit(false),
651653
EmitAsyncFramePushPopMetadata(true), EmitTypeMallocForCoroFrame(true),
652654
AsyncFramePointerAll(false), UseProfilingMarkerThunks(false),
653-
UseCoroCCX8664(false), UseCoroCCArm64(false),
654-
MergeableTraps(false),
655+
UseCoroCCX8664(false), UseCoroCCArm64(false), MergeableTraps(false),
655656
DebugInfoForProfiling(false), CmdArgs(),
656657
SanitizeCoverage(llvm::SanitizerCoverageOptions()),
657658
TypeInfoFilter(TypeInfoDumpFilter::All),
658659
PlatformCCallingConvention(llvm::CallingConv::C), UseCASBackend(false),
659-
CASObjMode(llvm::CASBackendMode::Native) {
660+
CASObjMode(llvm::CASBackendMode::Native), HasAArch64TBI(false) {
660661
DisableRoundTripDebugTypes = !CONDITIONAL_ASSERT_enabled();
661662
}
662663

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,9 +679,6 @@ namespace swift {
679679
bool RestrictNonProductionExperimentalFeatures = false;
680680
#endif
681681

682-
/// Set to true if we support AArch64TBI.
683-
bool HasAArch64TBI = false;
684-
685682
bool isConcurrencyModelTaskToThread() const {
686683
return ActiveConcurrencyModel == ConcurrencyModel::TaskToThread;
687684
}

lib/DriverTool/sil_llvm_gen_main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ int sil_llvm_gen_main(ArrayRef<const char *> argv, void *MainAddr) {
167167
IRGenOptions &Opts = Invocation.getIRGenOptions();
168168
Opts.OutputKind = options.OutputKind;
169169
Opts.DisableLegacyTypeInfo = options.DisableLegacyTypeInfo;
170+
Invocation.computeAArch64TBIOptions();
170171

171172
serialization::ExtendedValidationInfo extendedInfo;
172173
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> FileBufOrErr =

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ void CompilerInvocation::computeAArch64TBIOptions() {
377377
auto &LLVMArgs = getFrontendOptions().LLVMArgs;
378378
auto aarch64_use_tbi =
379379
std::find(LLVMArgs.begin(), LLVMArgs.end(), "-aarch64-use-tbi");
380-
LangOpts.HasAArch64TBI = aarch64_use_tbi != LLVMArgs.end();
380+
IRGenOpts.HasAArch64TBI = aarch64_use_tbi != LLVMArgs.end();
381381
}
382382

383383
void CompilerInvocation::computeCXXStdlibOptions() {

0 commit comments

Comments
 (0)