Skip to content

Commit 605437a

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). (cherry picked from commit 361e63c)
1 parent 7fcc8a5 commit 605437a

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

include/swift/AST/IRGenOptions.h

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

607+
/// Set to true if we support AArch64TBI.
608+
bool HasAArch64TBI = false;
609+
607610
IRGenOptions()
608611
: OutputKind(IRGenOutputKind::LLVMAssemblyAfterOptimization),
609612
Verify(true), VerifyEach(false), OptMode(OptimizationMode::NotSet),
@@ -649,13 +652,12 @@ class IRGenOptions {
649652
UseFragileResilientProtocolWitnesses(false), EnableHotColdSplit(false),
650653
EmitAsyncFramePushPopMetadata(true), EmitTypeMallocForCoroFrame(true),
651654
AsyncFramePointerAll(false), UseProfilingMarkerThunks(false),
652-
UseCoroCCX8664(false), UseCoroCCArm64(false),
653-
MergeableTraps(false),
655+
UseCoroCCX8664(false), UseCoroCCArm64(false), MergeableTraps(false),
654656
DebugInfoForProfiling(false), CmdArgs(),
655657
SanitizeCoverage(llvm::SanitizerCoverageOptions()),
656658
TypeInfoFilter(TypeInfoDumpFilter::All),
657659
PlatformCCallingConvention(llvm::CallingConv::C), UseCASBackend(false),
658-
CASObjMode(llvm::CASBackendMode::Native) {
660+
CASObjMode(llvm::CASBackendMode::Native), HasAArch64TBI(false) {
659661
DisableRoundTripDebugTypes = !CONDITIONAL_ASSERT_enabled();
660662
}
661663

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,6 @@ namespace swift {
652652
bool RestrictNonProductionExperimentalFeatures = false;
653653
#endif
654654

655-
/// Set to true if we support AArch64TBI.
656-
bool HasAArch64TBI = false;
657-
658655
bool isConcurrencyModelTaskToThread() const {
659656
return ActiveConcurrencyModel == ConcurrencyModel::TaskToThread;
660657
}

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
@@ -384,7 +384,7 @@ void CompilerInvocation::computeAArch64TBIOptions() {
384384
auto &LLVMArgs = getFrontendOptions().LLVMArgs;
385385
auto aarch64_use_tbi =
386386
std::find(LLVMArgs.begin(), LLVMArgs.end(), "-aarch64-use-tbi");
387-
LangOpts.HasAArch64TBI = aarch64_use_tbi != LLVMArgs.end();
387+
IRGenOpts.HasAArch64TBI = aarch64_use_tbi != LLVMArgs.end();
388388
}
389389

390390
void CompilerInvocation::computeCXXStdlibOptions() {

0 commit comments

Comments
 (0)