[PATCH] D91789: [clang-tidy] find/fix unneeded trailing semicolons in macros

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 19 07:04:28 PST 2020


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/linuxkernel/MacroTrailingSemiCheck.cpp:31
+                    const MacroDirective *MD) override {
+    auto *MI = MD->getMacroInfo();
+
----------------
Please don't use auto when type is not spelled explicitly in same statement or iterator.


================
Comment at: clang-tools-extra/clang-tidy/linuxkernel/MacroTrailingSemiCheck.cpp:99
+          if (Loc.isMacroID()) {
+            auto &SM = Result.Context->getSourceManager();
+            FullSourceLoc SpellingLoc = FullSourceLoc(Loc, SM).getSpellingLoc();
----------------
Please don't use auto when type is not spelled explicitly in same statement or iterator.


================
Comment at: clang-tools-extra/clang-tidy/linuxkernel/MacroTrailingSemiCheck.cpp:113
+              if (TI != MI->tokens_end()) {
+                auto Tok = MI->getReplacementToken(MI->getNumTokens() - 1);
+                SourceLocation FixLoc = Tok.getLocation();
----------------
Please don't use auto when type is not spelled explicitly in same statement or iterator.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91789



More information about the cfe-commits mailing list