Index: clang-rename/tool/ClangRename.cpp =================================================================== --- clang-rename/tool/ClangRename.cpp +++ clang-rename/tool/ClangRename.cpp @@ -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 #include +#include using namespace llvm; @@ -79,12 +78,6 @@ 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 @@ 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 @@ 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); } Index: test/clang-rename/InvalidNewName.cpp =================================================================== --- test/clang-rename/InvalidNewName.cpp +++ test/clang-rename/InvalidNewName.cpp @@ -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.