]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Rename/USRFinder.h
Merge clang 7.0.1 and several follow-up changes
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Tooling / Refactoring / Rename / USRFinder.h
1 //===--- USRFinder.h - Clang refactoring library --------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// Methods for determining the USR of a symbol at a location in source
12 /// code.
13 ///
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDER_H
17 #define LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDER_H
18
19 #include "clang/AST/AST.h"
20 #include "clang/AST/ASTContext.h"
21 #include <string>
22 #include <vector>
23
24 namespace clang {
25
26 class ASTContext;
27 class Decl;
28 class SourceLocation;
29 class NamedDecl;
30
31 namespace tooling {
32
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);
37
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);
43
44 // Converts a Decl into a USR.
45 std::string getUSRForDecl(const Decl *Decl);
46
47 } // end namespace tooling
48 } // end namespace clang
49
50 #endif // LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDER_H