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

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 7 01:55:01 PDT 2021


steakhal added a comment.

I would rather match on the complete line (except the file descriptor ofc).

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)

It should have found it! It exists, but ill-formed. @martong what did we misconfigure?

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.

What about this?

  // RUN ... 2>&1 | grep 'invocations\.yaml' | FileCheck %s
  void foo() {
    // It finds the invocation yaml, then it tries to parse it which expected to fail.
    bar();
    // CHECK: openat(AT_FDCWD, "{{[^"]+}}invocations.yaml", O_RDONLY|O_CLOEXEC) = {{[0-9]+}}
  
    // We should remember that the parsing failed, we shouldn't try to reopen and parse the yaml again.
    bar();
    // CHECK-NOT: openat(AT_FDCWD, "{{[^"]+}}invocations.yaml", O_RDONLY|O_CLOEXEC) = {{[0-9]+}}
  }

This way we are sure that the file opened (it resulted in a non-negative file descriptor) and opened only once!


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

https://reviews.llvm.org/D101763



More information about the cfe-commits mailing list