[clang-tools-extra] r230497 - [clang-tidy] Use the new ArrayRef<FixItHint> inserter.

Alexander Kornienko alexfh at google.com
Wed Feb 25 06:42:03 PST 2015


Author: alexfh
Date: Wed Feb 25 08:42:02 2015
New Revision: 230497

URL: http://llvm.org/viewvc/llvm-project?rev=230497&view=rev
Log:
[clang-tidy] Use the new ArrayRef<FixItHint> inserter.

Modified:
    clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.cpp

Modified: clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.cpp?rev=230497&r1=230496&r2=230497&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.cpp Wed Feb 25 08:42:02 2015
@@ -124,15 +124,12 @@ public:
       // changed the header guard or not.
       if (!FixIts.empty()) {
         if (CurHeaderGuard != NewGuard) {
-          auto D = Check->diag(Ifndef,
-                               "header guard does not follow preferred style");
-          for (FixItHint &Fix : FixIts)
-            D.AddFixItHint(std::move(Fix));
+          Check->diag(Ifndef, "header guard does not follow preferred style")
+              << FixIts;
         } else {
-          auto D = Check->diag(EndIf, "#endif for a header guard should "
-                                      "reference the guard macro in a comment");
-          for (FixItHint &Fix : FixIts)
-            D.AddFixItHint(std::move(Fix));
+          Check->diag(EndIf, "#endif for a header guard should reference the "
+                             "guard macro in a comment")
+              << FixIts;
         }
       }
     }





More information about the cfe-commits mailing list