[PATCH] D56902: [clang-tidy] Use getStripPluginsAdjuster

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 18 02:17:17 PST 2019


kadircet created this revision.
kadircet added a reviewer: alexfh.
Herald added subscribers: cfe-commits, xazax.hun.

See rC351531 <https://reviews.llvm.org/rC351531> for the introduction of getStripPluginsAdjuster.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D56902

Files:
  clang-tidy/ClangTidy.cpp


Index: clang-tidy/ClangTidy.cpp
===================================================================
--- clang-tidy/ClangTidy.cpp
+++ clang-tidy/ClangTidy.cpp
@@ -529,24 +529,8 @@
         return AdjustedArgs;
       };
 
-  // Remove plugins arguments.
-  ArgumentsAdjuster PluginArgumentsRemover =
-      [](const CommandLineArguments &Args, StringRef Filename) {
-        CommandLineArguments AdjustedArgs;
-        for (size_t I = 0, E = Args.size(); I < E; ++I) {
-          if (I + 4 < Args.size() && Args[I] == "-Xclang" &&
-              (Args[I + 1] == "-load" || Args[I + 1] == "-add-plugin" ||
-               StringRef(Args[I + 1]).startswith("-plugin-arg-")) &&
-              Args[I + 2] == "-Xclang") {
-            I += 3;
-          } else
-            AdjustedArgs.push_back(Args[I]);
-        }
-        return AdjustedArgs;
-      };
-
   Tool.appendArgumentsAdjuster(PerFileExtraArgumentsInserter);
-  Tool.appendArgumentsAdjuster(PluginArgumentsRemover);
+  Tool.appendArgumentsAdjuster(getStripPluginsAdjuster());
   Context.setEnableProfiling(EnableCheckProfile);
   Context.setProfileStoragePrefix(StoreCheckProfile);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56902.182483.patch
Type: text/x-patch
Size: 1144 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190118/9b780658/attachment.bin>


More information about the cfe-commits mailing list