[PATCH] D98275: [clang-tidy] Fix mpi checks when running multiple TUs per clang-tidy process

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 24 12:30:27 PDT 2021


njames93 marked 2 inline comments as done.
njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/mpi/BufferDerefCheck.cpp:29-30
 
+  if (!FuncClassifier)
+    FuncClassifier.emplace(*Result.Context);
+
----------------
aaron.ballman wrote:
> njames93 wrote:
> > aaron.ballman wrote:
> > > This is racy, but I don't think we support running multiple checks in parallel, do we?
> > This isn't racy as one instance of a check will only ever run on one thread. 
> I was thinking if the check gets run multiple times in parallel on different source files (e.g., someone downstream who incorporates the checks as a library in a creative way rather than runs clang-tidy as a command line tool). But yeah, I'm not worried about it as I don't think we support that sort of thing.
Plenty of other checks hold state that is mutated in the check callback, so if this is a race, all the other checks that mutate state in the callbacks will also have a race.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98275



More information about the cfe-commits mailing list