blob: 4c059a56184ff0fff8f63c9878b2a75d09be2b38 [file] [log] [blame]
Manuel Klimekde237262014-08-20 01:39:05 +00001//===--- 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
20namespace clang {
21class ASTConsumer;
22class CompilerInstance;
23class NamedDecl;
24
25namespace rename {
26
27struct 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
41private:
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_