Skip to content

Commit 2611c7e

Browse files
authored
Merge pull request swiftlang#34191 from nkcsgexi/diagnost-missing-baseline
ABIChecker: abort if given baseline file is absent
2 parents f9ebee2 + 8691810 commit 2611c7e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tools/swift-api-digester/swift-api-digester.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,11 +2809,6 @@ static std::string getCustomBaselinePath(llvm::Triple Triple, bool ABI) {
28092809

28102810
static SDKNodeRoot *getBaselineFromJson(const char *Main, SDKContext &Ctx) {
28112811
SwiftDeclCollector Collector(Ctx);
2812-
// If the baseline path has been given, honor that.
2813-
if (!options::BaselineFilePath.empty()) {
2814-
Collector.deSerialize(options::BaselineFilePath);
2815-
return Collector.getSDKRoot();
2816-
}
28172812
CompilerInvocation Invok;
28182813
llvm::StringSet<> Modules;
28192814
// We need to call prepareForDump to parse target triple.
@@ -2823,7 +2818,10 @@ static SDKNodeRoot *getBaselineFromJson(const char *Main, SDKContext &Ctx) {
28232818
assert(Modules.size() == 1 &&
28242819
"Cannot find builtin baseline for more than one module");
28252820
std::string Path;
2826-
if (!options::BaselineDirPath.empty()) {
2821+
// If the baseline path has been given, honor that.
2822+
if (!options::BaselineFilePath.empty()) {
2823+
Path = options::BaselineFilePath;
2824+
} else if (!options::BaselineDirPath.empty()) {
28272825
Path = getCustomBaselinePath(Invok.getLangOptions().Target,
28282826
Ctx.checkingABI());
28292827
} else if (options::UseEmptyBaseline) {

0 commit comments

Comments
 (0)