mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge remote-tracking branch 'origin/master' into master-next
This commit is contained in:
@@ -239,6 +239,11 @@ static llvm::cl::opt<std::string>
|
||||
BaselineFilePath("baseline-path",
|
||||
llvm::cl::desc("The path to the Json file that we should use as the baseline"),
|
||||
llvm::cl::cat(Category));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
UseEmptyBaseline("empty-baseline",
|
||||
llvm::cl::desc("Use empty baseline for diagnostics"),
|
||||
llvm::cl::cat(Category));
|
||||
} // namespace options
|
||||
|
||||
namespace {
|
||||
@@ -2570,28 +2575,33 @@ static SDKNodeRoot *getBaselineFromJson(const char *Main, SDKContext &Ctx) {
|
||||
llvm::SmallString<128> BaselinePath(ExePath);
|
||||
llvm::sys::path::remove_filename(BaselinePath); // Remove /swift-api-digester
|
||||
llvm::sys::path::remove_filename(BaselinePath); // Remove /bin
|
||||
llvm::sys::path::append(BaselinePath, "lib", "swift", "FrameworkABIBaseline",
|
||||
Modules.begin()->getKey());
|
||||
// Look for ABI or API baseline
|
||||
if (Ctx.checkingABI())
|
||||
llvm::sys::path::append(BaselinePath, "ABI");
|
||||
else
|
||||
llvm::sys::path::append(BaselinePath, "API");
|
||||
// Look for deployment target specific baseline files.
|
||||
auto Triple = Invok.getLangOptions().Target;
|
||||
if (Triple.isMacCatalystEnvironment())
|
||||
llvm::sys::path::append(BaselinePath, "iosmac.json");
|
||||
else if (Triple.isMacOSX())
|
||||
llvm::sys::path::append(BaselinePath, "macos.json");
|
||||
else if (Triple.isiOS())
|
||||
llvm::sys::path::append(BaselinePath, "iphoneos.json");
|
||||
else if (Triple.isTvOS())
|
||||
llvm::sys::path::append(BaselinePath, "appletvos.json");
|
||||
else if (Triple.isWatchOS())
|
||||
llvm::sys::path::append(BaselinePath, "watchos.json");
|
||||
else {
|
||||
llvm::errs() << "Unsupported triple target\n";
|
||||
exit(1);
|
||||
llvm::sys::path::append(BaselinePath, "lib", "swift", "FrameworkABIBaseline");
|
||||
if (options::UseEmptyBaseline) {
|
||||
// Use the empty baseline for comparison.
|
||||
llvm::sys::path::append(BaselinePath, "nil.json");
|
||||
} else {
|
||||
llvm::sys::path::append(BaselinePath, Modules.begin()->getKey());
|
||||
// Look for ABI or API baseline
|
||||
if (Ctx.checkingABI())
|
||||
llvm::sys::path::append(BaselinePath, "ABI");
|
||||
else
|
||||
llvm::sys::path::append(BaselinePath, "API");
|
||||
// Look for deployment target specific baseline files.
|
||||
auto Triple = Invok.getLangOptions().Target;
|
||||
if (Triple.isMacCatalystEnvironment())
|
||||
llvm::sys::path::append(BaselinePath, "iosmac.json");
|
||||
else if (Triple.isMacOSX())
|
||||
llvm::sys::path::append(BaselinePath, "macos.json");
|
||||
else if (Triple.isiOS())
|
||||
llvm::sys::path::append(BaselinePath, "iphoneos.json");
|
||||
else if (Triple.isTvOS())
|
||||
llvm::sys::path::append(BaselinePath, "appletvos.json");
|
||||
else if (Triple.isWatchOS())
|
||||
llvm::sys::path::append(BaselinePath, "watchos.json");
|
||||
else {
|
||||
llvm::errs() << "Unsupported triple target\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
StringRef Path = BaselinePath.str();
|
||||
if (!fs::exists(Path)) {
|
||||
|
||||
Reference in New Issue
Block a user