[PATCH] D117522: [clang-tidy] Add modernize-macro-to-enum check

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 17 17:38:34 PST 2022


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.h:19
+
+/// FIXME: Write a short description.
+///
----------------
njames93 wrote:
> FIXME
Please do this :-)


================
Comment at: clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp:63
     CheckFactories.registerCheck<LoopConvertCheck>("modernize-loop-convert");
+    CheckFactories.registerCheck<MacroToEnumCheck>(
+        "modernize-macro-to-enum");
----------------
Please address this.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/modernize-macro-to-enum.rst:6
+
+This check performs basic analysis of macros and replaces them
+with an anonymous unscoped enum.  Using an unscoped anonymous enum
----------------
Please make first statement same as in Release Notes. `This check` should be omitted.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/modernize-macro-to-enum.rst:45
+  enum {
+  RED = 0xFF0000,
+  GREEN = 0x00FF00,
----------------
It'll be reasonable to support indentation. Option could be used to specify string (tab or several spaces).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117522



More information about the cfe-commits mailing list