[PATCH] D101763: [analyzer][ctu] Avoid parsing invocation list again and again during on-demand parsing of CTU
Balázs Kéri via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 5 00:11:53 PDT 2021
balazske added inline comments.
================
Comment at: clang/lib/CrossTU/CrossTranslationUnit.cpp:670
return llvm::Error::success();
+ else if (index_error_code::no_error != InvocationListParsingError)
+ return llvm::make_error<IndexError>(InvocationListParsingError);
----------------
martong wrote:
> The `if` here is superfluous because the condition must be `true` always, otherwise we would have an `InvocationList`, wouldn't we?
>
> Or we can have this condition, but then the `if (InvocatioList)` is not needed.
This looks correct: We have an InvocationList if it is usable as result (initialized and no error). Otherwise there is an error or it is the first time the function is called. The second `if` checks for this condition.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101763/new/
https://reviews.llvm.org/D101763
More information about the cfe-commits
mailing list