clang-tools  3.9.0
USRFindingAction.h
Go to the documentation of this file.
1 //===--- tools/extra/clang-rename/USRFindingAction.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 Provides an action to find all relevant USRs at a point.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H_
16 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H_
17 
18 #include "clang/Frontend/FrontendAction.h"
19 
20 namespace clang {
21 class ASTConsumer;
22 class CompilerInstance;
23 class NamedDecl;
24 
25 namespace rename {
26 
28  USRFindingAction(unsigned Offset, const std::string &Name)
29  : SymbolOffset(Offset), OldName(Name) {}
30  std::unique_ptr<ASTConsumer> newASTConsumer();
31 
32  // \brief get the spelling of the USR(s) as it would appear in source files.
33  const std::string &getUSRSpelling() { return SpellingName; }
34 
35  const std::vector<std::string> &getUSRs() { return USRs; }
36 
37 private:
38  unsigned SymbolOffset;
39  std::string OldName;
40  std::string SpellingName;
41  std::vector<std::string> USRs;
42 };
43 
44 } // namespace rename
45 } // namespace clang
46 
47 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H_
const std::string Name
Definition: USRFinder.cpp:140
const std::vector< std::string > & getUSRs()
const std::string & getUSRSpelling()
std::unique_ptr< ASTConsumer > newASTConsumer()
USRFindingAction(unsigned Offset, const std::string &Name)