mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #39083 from beccadax/give-me-some-e
Add arm64 -> arm64e fallback to module loading
This commit is contained in:
@@ -46,8 +46,23 @@ namespace {
|
||||
void forEachTargetModuleBasename(const ASTContext &Ctx,
|
||||
llvm::function_ref<void(StringRef)> body) {
|
||||
auto normalizedTarget = getTargetSpecificModuleTriple(Ctx.LangOpts.Target);
|
||||
|
||||
// An arm64 module can import an arm64e module.
|
||||
Optional<llvm::Triple> normalizedAltTarget;
|
||||
if ((normalizedTarget.getArch() == llvm::Triple::ArchType::aarch64) &&
|
||||
(normalizedTarget.getSubArch() !=
|
||||
llvm::Triple::SubArchType::AArch64SubArch_arm64e)) {
|
||||
auto altTarget = normalizedTarget;
|
||||
altTarget.setArchName("arm64e");
|
||||
normalizedAltTarget = getTargetSpecificModuleTriple(altTarget);
|
||||
}
|
||||
|
||||
body(normalizedTarget.str());
|
||||
|
||||
if (normalizedAltTarget) {
|
||||
body(normalizedAltTarget->str());
|
||||
}
|
||||
|
||||
// We used the un-normalized architecture as a target-specific
|
||||
// module name. Fall back to that behavior.
|
||||
body(Ctx.LangOpts.Target.getArchName());
|
||||
@@ -61,6 +76,10 @@ void forEachTargetModuleBasename(const ASTContext &Ctx,
|
||||
if (Ctx.LangOpts.Target.getArch() == llvm::Triple::ArchType::arm) {
|
||||
body("arm");
|
||||
}
|
||||
|
||||
if (normalizedAltTarget) {
|
||||
body(normalizedAltTarget->getArchName());
|
||||
}
|
||||
}
|
||||
|
||||
enum class SearchPathKind {
|
||||
|
||||
Reference in New Issue
Block a user