| Manuel Klimek | de23726 | 2014-08-20 01:39:05 +0000 | [diff] [blame] | 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 relevent 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 |  | 
|  | 27 | struct USRFindingAction { | 
|  | 28 | USRFindingAction(unsigned Offset) : SymbolOffset(Offset) { | 
|  | 29 | } | 
|  | 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() { | 
|  | 34 | return SpellingName; | 
|  | 35 | } | 
|  | 36 |  | 
|  | 37 | const std::vector<std::string> &getUSRs() { | 
|  | 38 | return USRs; | 
|  | 39 | } | 
|  | 40 |  | 
|  | 41 | private: | 
|  | 42 | unsigned SymbolOffset; | 
|  | 43 | std::string SpellingName; | 
|  | 44 | std::vector<std::string> USRs; | 
|  | 45 | }; | 
|  | 46 |  | 
|  | 47 | } | 
|  | 48 | } | 
|  | 49 |  | 
|  | 50 | #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H_ |