mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[frontend] Expose via a LangOption whether or not the compiler is compiling for a triple that supports AArch64 TBI.
Just breaking down layers of a larger patch to make it easier to review.
This commit is contained in:
@@ -371,6 +371,13 @@ setBridgingHeaderFromFrontendOptions(ClangImporterOptions &ImporterOpts,
|
||||
FrontendOpts.InputsAndOutputs.getFilenameOfFirstInput();
|
||||
}
|
||||
|
||||
void CompilerInvocation::computeAArch64TBIOptions() {
|
||||
auto &LLVMArgs = getFrontendOptions().LLVMArgs;
|
||||
auto aarch64_use_tbi =
|
||||
std::find(LLVMArgs.begin(), LLVMArgs.end(), "-aarch64-use-tbi");
|
||||
LangOpts.HasAArch64TBI = aarch64_use_tbi != LLVMArgs.end();
|
||||
}
|
||||
|
||||
void CompilerInvocation::computeCXXStdlibOptions() {
|
||||
// The MSVC driver in Clang is not aware of the C++ stdlib, and currently
|
||||
// always assumes libstdc++, which is incorrect: the Microsoft stdlib is
|
||||
@@ -4099,6 +4106,8 @@ bool CompilerInvocation::parseArgs(
|
||||
setIRGenOutputOptsFromFrontendOptions(IRGenOpts, FrontendOpts);
|
||||
setBridgingHeaderFromFrontendOptions(ClangImporterOpts, FrontendOpts);
|
||||
computeCXXStdlibOptions();
|
||||
computeAArch64TBIOptions();
|
||||
|
||||
if (LangOpts.hasFeature(Feature::Embedded)) {
|
||||
IRGenOpts.InternalizeAtLink = true;
|
||||
IRGenOpts.DisableLegacyTypeInfo = true;
|
||||
|
||||
Reference in New Issue
Block a user