clang-tools  3.9.0
USRFinder.h
Go to the documentation of this file.
1 //===--- tools/extra/clang-rename/USRFinder.h - Clang rename tool ---------===//
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 /// \brief Methods for determining the USR of a symbol at a location in source
12 /// code.
13 ///
14 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDER_H
16 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDER_H
17 
18 #include <string>
19 
20 namespace clang {
21 class ASTContext;
22 class Decl;
23 class SourceLocation;
24 class NamedDecl;
25 
26 namespace rename {
27 
28 // Given an AST context and a point, returns a NamedDecl identifying the symbol
29 // at the point. Returns null if nothing is found at the point.
30 const NamedDecl *getNamedDeclAt(const ASTContext &Context,
31  const SourceLocation Point);
32 
33 // Given an AST context and a fully qualified name, returns a NamedDecl
34 // identifying the symbol with a matching name. Returns null if nothing is
35 // found for the name.
36 const NamedDecl *getNamedDeclFor(const ASTContext &Context,
37  const std::string &Name);
38 
39 // Converts a Decl into a USR.
40 std::string getUSRForDecl(const Decl *Decl);
41 
42 }
43 }
44 
45 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDER_H
const std::string Name
Definition: USRFinder.cpp:140
const SourceLocation Point
Definition: USRFinder.cpp:139
const NamedDecl * getNamedDeclAt(const ASTContext &Context, const SourceLocation Point)
Definition: USRFinder.cpp:144
std::string getUSRForDecl(const Decl *Decl)
Definition: USRFinder.cpp:184
const NamedDecl * getNamedDeclFor(const ASTContext &Context, const std::string &Name)
Definition: USRFinder.cpp:168
ClangTidyContext & Context
Definition: ClangTidy.cpp:93