ABI/API checker: abort after error occurs while importing a module

This commit is contained in:
Xi Ge
2019-08-21 15:57:36 -07:00
parent cfaecfc015
commit d4bfae8595
2 changed files with 8 additions and 3 deletions

View File

@@ -2102,7 +2102,7 @@ swift::ide::api::getSDKNodeRoot(SDKContext &SDKCtx,
if (Opts.Verbose)
llvm::errs() << "Loading module: " << Name << "...\n";
auto *M = Ctx.getModuleByName(Name);
if (!M || M->failedToLoad()) {
if (!M || M->failedToLoad() || Ctx.Diags.hadAnyError()) {
llvm::errs() << "Failed to load module: " << Name << '\n';
if (Opts.AbortOnModuleLoadFailure)
return nullptr;