[PATCH] D75184: [clang-tidy] Optional inheritance of file configs from parent directories 

Dmitry Polukhin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 29 05:56:32 PDT 2020


DmitryPolukhin added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/ClangTidyOptions.cpp:116-121
+  unsigned Priority = 0;
   for (ClangTidyModuleRegistry::iterator I = ClangTidyModuleRegistry::begin(),
                                          E = ClangTidyModuleRegistry::end();
        I != E; ++I)
-    Options = Options.mergeWith(I->instantiate()->getModuleOptions());
+    Options =
+        Options.mergeWith(I->instantiate()->getModuleOptions(), ++Priority);
----------------
njames93 wrote:
> Is there a reason for incrementing the priority on each successive iteration, Seems like a bug that will lead to the later registered modules having higher priority for their options.
It seems that you are right and it is just a bug. Modules are registered as static object in different translation units so there is no guarantee about their order. But in general I didn't expect conflicting options here. If you have a diff, I'll be happy to stamp it; if not, I'll create the diff.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75184



More information about the cfe-commits mailing list