[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:13:57 PDT 2021


balazske added inline comments.


================
Comment at: clang/include/clang/CrossTU/CrossTranslationUnit.h:257
     llvm::Optional<InvocationListTy> InvocationList;
+    index_error_code InvocationListParsingError = index_error_code::no_error;
   };
----------------
martong wrote:
> I think it would be more consistent to make this an `llvm::Error`. I.e. we would store the result of the whole `lazyInitInvocationList` in this member variable. And as such, a better name could be `PreviousResult`. And this could be an `Optional` to indicate that we have never called `lazyInitInvocationList` before.
> This means we would check in `lazyInitInvocationList` whether the `PreviousResult` is set and if yes is it an error. And if both conditions are true then return with the stashed error.
The current solution looks good, probably it is more convenient to store the result in a `llvm::Error`.


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