1 //===--- USRFinder.h - Clang refactoring library --------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// Methods for determining the USR of a symbol at a location in source
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDER_H
16 #define LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDER_H
18 #include "clang/AST/AST.h"
19 #include "clang/AST/ASTContext.h"
32 // Given an AST context and a point, returns a NamedDecl identifying the symbol
33 // at the point. Returns null if nothing is found at the point.
34 const NamedDecl *getNamedDeclAt(const ASTContext &Context,
35 const SourceLocation Point);
37 // Given an AST context and a fully qualified name, returns a NamedDecl
38 // identifying the symbol with a matching name. Returns null if nothing is
39 // found for the name.
40 const NamedDecl *getNamedDeclFor(const ASTContext &Context,
41 const std::string &Name);
43 // Converts a Decl into a USR.
44 std::string getUSRForDecl(const Decl *Decl);
46 } // end namespace tooling
47 } // end namespace clang
49 #endif // LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDER_H