Skip to content

Commit 361e63c

Browse files
committed
[irgen] Make HasAArch64TBI an IRGen option instead of a LangOpts.
With some changes that I am making, we will no longer need this flag at the SIL level, so we can just make it an IRGen flag (which it really should have been in the first place).
1 parent 80f052e commit 361e63c

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
@@ -674,9 +674,6 @@ namespace swift {
674674
bool RestrictNonProductionExperimentalFeatures = false;
675675
#endif
676676

677-
/// Set to true if we support AArch64TBI.
678-
bool HasAArch64TBI = false;
679-
680677
bool isConcurrencyModelTaskToThread() const {
681678
return ActiveConcurrencyModel == ConcurrencyModel::TaskToThread;
682679
}

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
@@ -375,7 +375,7 @@ void CompilerInvocation::computeAArch64TBIOptions() {
375375
auto &LLVMArgs = getFrontendOptions().LLVMArgs;
376376
auto aarch64_use_tbi =
377377
std::find(LLVMArgs.begin(), LLVMArgs.end(), "-aarch64-use-tbi");
378-
LangOpts.HasAArch64TBI = aarch64_use_tbi != LLVMArgs.end();
378+
IRGenOpts.HasAArch64TBI = aarch64_use_tbi != LLVMArgs.end();
379379
}
380380

381381
void CompilerInvocation::computeCXXStdlibOptions() {

0 commit comments

Comments
 (0)