summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-rename/USRFinder.h
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2014-08-17 18:00:59 +0000
committerManuel Klimek <klimek@google.com>2014-08-17 18:00:59 +0000
commitccf0d797242da0656896bc38e1f6b7303e7ab91a (patch)
treebfe41e056b7dcf363c2ae5aacaf435f0403c903d /clang-tools-extra/clang-rename/USRFinder.h
parentab73774c4771a7e310d403934d0c961eb0ad213b (diff)
downloadbcm5719-llvm-ccf0d797242da0656896bc38e1f6b7303e7ab91a.tar.gz
bcm5719-llvm-ccf0d797242da0656896bc38e1f6b7303e7ab91a.zip
First version of a clang-rename tool.
Summary: Note that this code is still grossly under-tested - the next steps will be to add significantly better test coverage. Patch by Matthew Plant. Test Plan: Reviewers: Subscribers: llvm-svn: 215839
Diffstat (limited to 'clang-tools-extra/clang-rename/USRFinder.h')
-rw-r--r--clang-tools-extra/clang-rename/USRFinder.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-rename/USRFinder.h b/clang-tools-extra/clang-rename/USRFinder.h
new file mode 100644
index 00000000000..2de6f4272af
--- /dev/null
+++ b/clang-tools-extra/clang-rename/USRFinder.h
@@ -0,0 +1,39 @@
+//===--- tools/extra/clang-rename/USRFinder.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 Methods for determining the USR of a symbol at a location in source
+/// code.
+///
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDER_H
+
+#include <string>
+
+namespace clang {
+class ASTContext;
+class Decl;
+class SourceLocation;
+class NamedDecl;
+
+namespace rename {
+
+// Given an AST context and a point, returns a NamedDecl identifying the symbol
+// at the point. Returns null if nothing is found at the point.
+const NamedDecl *getNamedDeclAt(const ASTContext &Context,
+ const SourceLocation Point);
+
+// Converts a Decl into a USR.
+std::string getUSRForDecl(const Decl *Decl);
+
+}
+}
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDER_H
OpenPOWER on IntegriCloud