[PATCH] D22654: [Clang-rename] Remove custom version, fix extra space in error message
Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 25 13:37:57 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL276684: [Clang-rename] Remove custom version, fix extra space in error message. (authored by eugenezelenko).
Changed prior to commit:
https://reviews.llvm.org/D22654?vs=65379&id=65412#toc
Repository:
rL LLVM
https://reviews.llvm.org/D22654
Files:
clang-tools-extra/trunk/clang-rename/tool/ClangRename.cpp
clang-tools-extra/trunk/test/clang-rename/InvalidNewName.cpp
Index: clang-tools-extra/trunk/clang-rename/tool/ClangRename.cpp
===================================================================
--- clang-tools-extra/trunk/clang-rename/tool/ClangRename.cpp
+++ clang-tools-extra/trunk/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 <cstdlib>
#include <string>
+#include <system_error>
using namespace llvm;
@@ -79,21 +78,14 @@
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\
clang-rename renames every occurrence of a symbol found at <offset> in\n\
<source0>. If -i is specified, the edited files are overwritten to disk.\n\
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: clang-tools-extra/trunk/test/clang-rename/InvalidNewName.cpp
===================================================================
--- clang-tools-extra/trunk/test/clang-rename/InvalidNewName.cpp
+++ clang-tools-extra/trunk/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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22654.65412.patch
Type: text/x-patch
Size: 3189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160725/fc000d4c/attachment.bin>
More information about the cfe-commits
mailing list