[PATCH] D101763: [analyzer][ctu] Avoid parsing invocation list again and again during on-demand parsing of CTU

Ella Ma via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 7 03:14:24 PDT 2021


OikawaKirie updated this revision to Diff 343626.
OikawaKirie added a comment.

In D101763#2743984 <https://reviews.llvm.org/D101763#2743984>, @steakhal wrote:

> By inspecting the output that is piped to the `count`, I have a suspicion:
>
>   openat(AT_FDCWD, "invocations.yaml", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

According to the output of the failed test, it seems that CTU is not working during the test case execution (`Expected 1 lines, got 0.`). Otherwise, it should be matched by grep.
There seems to be something wrong with the test case, although it works well in my environment.

> My guess is that `ctu-invocation-list` is not using the `ctu-dir`. It should be a different bug though.
> To workaround this issue, simply use an absolute path for the invocation yaml.

It seems that you are correct, I will fix this problem later.
I can just `cd` to the `ctu-dir` before running CSA as a workaround. Just as the author of on-demand parsing did (refer to `clang/test/Analysis/ctu-on-demand-parsing.c`).

> `// CHECK: openat(AT_FDCWD, "{{[^"]+}}invocations.yaml", O_RDONLY|O_CLOEXEC) = {{[0-9]+}}`

I am not quite sure whether we need to verify the flags (`AT_FDCWD`, `O_RDONLY` and `O_CLOEXEC`) as well. Therefore, I removed them in this update.


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

https://reviews.llvm.org/D101763

Files:
  clang/include/clang/CrossTU/CrossTranslationUnit.h
  clang/lib/CrossTU/CrossTranslationUnit.cpp
  clang/test/Analysis/multiple-invocation-list-parsing.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101763.343626.patch
Type: text/x-patch
Size: 4315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210507/b4ce3797/attachment.bin>


More information about the cfe-commits mailing list