[analyzer][ctu] Avoid parsing invocation list again and again during on-demand parsin...
authorElla Ma <alansnape3058@gmail.com>
Tue, 25 May 2021 07:19:14 +0000 (09:19 +0200)
committerBalazs Benics <balazs.benics@sigmatechnology.se>
Tue, 25 May 2021 07:19:14 +0000 (09:19 +0200)
commitdb8af0f21dc9aad4d336754c857c24470afe53e3
tree9f5e324844960034862a355634e4a2868f08246f
parentbf77317049a880af541e31ba7ea43cb229ee4c0f
[analyzer][ctu] Avoid parsing invocation list again and again during on-demand parsing of CTU

During CTU, the *on-demand parsing* will read and parse the invocation
list to know how to compile the file being imported. However, it seems
that the invocation list will be parsed again if a previous parsing
has failed.
Then, parse again and fail again. This patch tries to overcome the
problem by storing the error code during the first parsing, and
re-create the stored error during the later parsings.

Reviewed By: steakhal

Patch By: OikawaKirie!

Differential Revision: https://reviews.llvm.org/D101763
clang/include/clang/CrossTU/CrossTranslationUnit.h
clang/lib/CrossTU/CrossTranslationUnit.cpp
clang/test/Analysis/ctu-on-demand-parsing-multiple-invocation-list-parsing.cpp [new file with mode: 0644]