ModuleInterface: sanitize arch when interface file name and encoded flags disagree

It's a known issue that we are using arm64e interfaces contents for the arm64 target,
meaning the encoded module flags are specifying -target arm64e-x-x instead of
-target arm64-x-x. Fortunately, we can tell the target arch from the interface file
name, so we could sanitize the target to use by inferring arch from the file name.
This commit is contained in:
Xi Ge
2021-06-16 19:28:48 -07:00
parent 5cd7d74775
commit 49c64cf902
4 changed files with 41 additions and 4 deletions

View File

@@ -469,7 +469,8 @@ public:
};
/// Extract compiler arguments from an interface file buffer.
bool extractCompilerFlagsFromInterface(StringRef buffer, llvm::StringSaver &ArgSaver,
bool extractCompilerFlagsFromInterface(StringRef interfacePath,
StringRef buffer, llvm::StringSaver &ArgSaver,
SmallVectorImpl<const char *> &SubArgs);
/// Extract the user module version number from an interface file.