summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-rename/USRFindingAction.h
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2014-08-20 01:39:05 +0000
committerManuel Klimek <klimek@google.com>2014-08-20 01:39:05 +0000
commitde23726dbd92b72a84b74725f7561adca0f1cee3 (patch)
tree63aa9d3e63f3a621d508fa7e38cc9049525d6ce5 /clang-tools-extra/clang-rename/USRFindingAction.h
parent0781b860e44add0aa306197c643ebe40087d9dad (diff)
downloadbcm5719-llvm-de23726dbd92b72a84b74725f7561adca0f1cee3.tar.gz
bcm5719-llvm-de23726dbd92b72a84b74725f7561adca0f1cee3.zip
Revert rL215947: "[clang-rename] revert r215839"
Make tests not depend on grep supporting -bo. llvm-svn: 216041
Diffstat (limited to 'clang-tools-extra/clang-rename/USRFindingAction.h')
-rw-r--r--clang-tools-extra/clang-rename/USRFindingAction.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-rename/USRFindingAction.h b/clang-tools-extra/clang-rename/USRFindingAction.h
new file mode 100644
index 00000000000..4c059a56184
--- /dev/null
+++ b/clang-tools-extra/clang-rename/USRFindingAction.h
@@ -0,0 +1,50 @@
+//===--- tools/extra/clang-rename/USRFindingAction.h - Clang rename tool --===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief Provides an action to find all relevent USRs at a point.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H_
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H_
+
+#include "clang/Frontend/FrontendAction.h"
+
+namespace clang {
+class ASTConsumer;
+class CompilerInstance;
+class NamedDecl;
+
+namespace rename {
+
+struct USRFindingAction {
+ USRFindingAction(unsigned Offset) : SymbolOffset(Offset) {
+ }
+ std::unique_ptr<ASTConsumer> newASTConsumer();
+
+ // \brief get the spelling of the USR(s) as it would appear in source files.
+ const std::string &getUSRSpelling() {
+ return SpellingName;
+ }
+
+ const std::vector<std::string> &getUSRs() {
+ return USRs;
+ }
+
+private:
+ unsigned SymbolOffset;
+ std::string SpellingName;
+ std::vector<std::string> USRs;
+};
+
+}
+}
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H_
OpenPOWER on IntegriCloud