martong added a comment.
@Szelethus @balazske Thanks for your review! The meantime I have discussed with
@xazax.hun that actually the called `ASTUnit::LoadFromASTFile` function inside
`loadExternalAST` may return with a nullptr. So, the best is to handle that
inside `loadExternalAST`.
xazax.hun accepted this revision.
xazax.hun added a comment.
This revision is now accepted and ready to land.
LG!
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55280/new/
https://reviews.llvm.org/D55280
___
martong updated this revision to Diff 176779.
martong added a comment.
- Return an error from loadExternalAST in case of nullptr
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55280/new/
https://reviews.llvm.org/D55280
Files:
balazske added inline comments.
Comment at: include/clang/CrossTU/CrossTranslationUnit.h:121
+ /// \return Returns a pointer to the ASTUnit that contains the definition of
+ /// the looked up function. The pointer should not be a nullptr.
///
Return value
Szelethus added a comment.
From what I can see, this patch LGTM, but I lack the experience in the CTU
department just yet to give any meaningful feedback.
Comment at: lib/CrossTU/CrossTranslationUnit.cpp:147
llvm::Expected
martong created this revision.
martong added reviewers: xazax.hun, a_sidorin, Szelethus, balazske.
Herald added subscribers: cfe-commits, gamesh411, dkrupp, rnkovacs.
In loadExternalAST we normally return with either an error or with a valid
ASTUnit pointer which should not be a nullptr.
However,