1 //===--- USRFinder.h - Clang refactoring library --------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// Methods for determining the USR of a symbol at a location in source
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDER_H
17 #define LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDER_H
19 #include "clang/AST/AST.h"
20 #include "clang/AST/ASTContext.h"
33 // Given an AST context and a point, returns a NamedDecl identifying the symbol
34 // at the point. Returns null if nothing is found at the point.
35 const NamedDecl *getNamedDeclAt(const ASTContext &Context,
36 const SourceLocation Point);
38 // Given an AST context and a fully qualified name, returns a NamedDecl
39 // identifying the symbol with a matching name. Returns null if nothing is
40 // found for the name.
41 const NamedDecl *getNamedDeclFor(const ASTContext &Context,
42 const std::string &Name);
44 // Converts a Decl into a USR.
45 std::string getUSRForDecl(const Decl *Decl);
47 } // end namespace tooling
48 } // end namespace clang
50 #endif // LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDER_H