[clang-tools-extra] r276684 - [Clang-rename] Remove custom version, fix extra space in error message.

Eugene Zelenko via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 25 13:30:13 PDT 2016


Author: eugenezelenko
Date: Mon Jul 25 15:30:13 2016
New Revision: 276684

URL: http://llvm.org/viewvc/llvm-project?rev=276684&view=rev
Log:
[Clang-rename] Remove custom version, fix extra space in error message.

Also fixed some Include What You Use Warnings.

Differential revision: https://reviews.llvm.org/D22654

Modified:
    clang-tools-extra/trunk/clang-rename/tool/ClangRename.cpp
    clang-tools-extra/trunk/test/clang-rename/InvalidNewName.cpp

Modified: clang-tools-extra/trunk/clang-rename/tool/ClangRename.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-rename/tool/ClangRename.cpp?rev=276684&r1=276683&r2=276684&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-rename/tool/ClangRename.cpp (original)
+++ clang-tools-extra/trunk/clang-rename/tool/ClangRename.cpp Mon Jul 25 15:30:13 2016
@@ -15,28 +15,27 @@
 
 #include "../USRFindingAction.h"
 #include "../RenamingAction.h"
-#include "clang/AST/ASTConsumer.h"
-#include "clang/AST/ASTContext.h"
+#include "clang/Basic/Diagnostic.h"
+#include "clang/Basic/DiagnosticOptions.h"
 #include "clang/Basic/FileManager.h"
+#include "clang/Basic/IdentifierTable.h"
 #include "clang/Basic/LangOptions.h"
-#include "clang/Basic/TargetInfo.h"
-#include "clang/Basic/TargetOptions.h"
-#include "clang/Frontend/CommandLineSourceLoc.h"
-#include "clang/Frontend/CompilerInstance.h"
-#include "clang/Frontend/FrontendAction.h"
+#include "clang/Basic/SourceManager.h"
+#include "clang/Basic/TokenKinds.h"
 #include "clang/Frontend/TextDiagnosticPrinter.h"
-#include "clang/Lex/Lexer.h"
-#include "clang/Lex/Preprocessor.h"
-#include "clang/Parse/ParseAST.h"
-#include "clang/Parse/Parser.h"
 #include "clang/Rewrite/Core/Rewriter.h"
 #include "clang/Tooling/CommonOptionsParser.h"
 #include "clang/Tooling/Refactoring.h"
 #include "clang/Tooling/ReplacementsYaml.h"
 #include "clang/Tooling/Tooling.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
-#include "llvm/Support/Host.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/YAMLTraits.h"
+#include <cstdlib>
 #include <string>
+#include <system_error>
 
 using namespace llvm;
 
@@ -79,12 +78,6 @@ ExportFixes(
     cl::value_desc("filename"),
     cl::cat(ClangRenameCategory));
 
-#define CLANG_RENAME_VERSION "0.0.1"
-
-static void PrintVersion() {
-  outs() << "clang-rename version " << CLANG_RENAME_VERSION << '\n';
-}
-
 using namespace clang;
 
 const char RenameUsage[] = "A tool to rename symbols in C/C++ code.\n\
@@ -93,7 +86,6 @@ clang-rename renames every occurrence of
 Otherwise, the results are written to stdout.\n";
 
 int main(int argc, const char **argv) {
-  cl::SetVersionPrinter(PrintVersion);
   tooling::CommonOptionsParser OP(argc, argv, ClangRenameCategory, RenameUsage);
 
   // Check the arguments for correctness.
@@ -110,7 +102,7 @@ int main(int argc, const char **argv) {
   IdentifierTable Table(Options);
   auto NewNameTokKind = Table.get(NewName).getTokenID();
   if (!tok::isAnyIdentifier(NewNameTokKind)) {
-    errs() << "ERROR: new name is not a valid identifier in  C++17.\n\n";
+    errs() << "ERROR: new name is not a valid identifier in C++17.\n\n";
     exit(1);
   }
 

Modified: clang-tools-extra/trunk/test/clang-rename/InvalidNewName.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/InvalidNewName.cpp?rev=276684&r1=276683&r2=276684&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-rename/InvalidNewName.cpp (original)
+++ clang-tools-extra/trunk/test/clang-rename/InvalidNewName.cpp Mon Jul 25 15:30:13 2016
@@ -1,2 +1,2 @@
 // RUN: not clang-rename -new-name=class -offset=133 %s 2>&1 | FileCheck %s
-// CHECK: ERROR: new name is not a valid identifier in  C++17.
+// CHECK: ERROR: new name is not a valid identifier in C++17.




More information about the cfe-commits mailing list