[PATCH] D55280: [CTU] Make loadExternalAST return with non nullptr on success

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 5 13:25:00 PST 2018


a_sidorin requested changes to this revision.
a_sidorin added a comment.
This revision now requires changes to proceed.

Hi Gabor,
There is a code in getExternalAST:

  std::unique_ptr<ASTUnit> LoadedUnit(ASTUnit::LoadFromASTFile(
      ASTFileName, CI.getPCHContainerOperations()->getRawReader(),
      ASTUnit::LoadEverything, Diags, CI.getFileSystemOpts()));
  Unit = LoadedUnit.get();
  FileASTUnitMap[ASTFileName] = std::move(LoadedUnit);

And `ASTUnit::LoadFromASTFile()`can return nullptr. Actually, there is a problem in `loadExternalAST()` - it ignores this fact.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55280/new/

https://reviews.llvm.org/D55280





More information about the cfe-commits mailing list