[PATCH] D142655: [clang-tidy] Introduce HeaderFileExtensions and ImplementationFileExtensions options

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 5 09:03:37 PST 2023


carlosgalvezp added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp:31
+    : ClangTidyCheck(Name, Context) {
+  std::optional<StringRef> HeaderFileExtensionsOption =
+      Options.get("HeaderFileExtensions");
----------------
Eugene.Zelenko wrote:
> Will be good idea to make function in `utils` instead of code duplication. 
I thought about that, but found it quite difficult due to the dependencies to Options and diag(), which are only available in ClangTidyCheck. This is probably why there was duplication to begin with.

I could add a helper function in ClangTidyCheck, but I find it out of place and I see risk in people using it as if it were a solid function meant to stay. Since this code is temporary I think the duplication is a small price to pay for keeping backwards compatibility. It will all be gone when we remove the local options.

I might have missed something, if you have some concrete suggestion that could work I'm happy to use it!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142655



More information about the cfe-commits mailing list