summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-rename/USRFindingAction.h
blob: 4c059a56184ff0fff8f63c9878b2a75d09be2b38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//===--- tools/extra/clang-rename/USRFindingAction.h - Clang rename tool --===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief Provides an action to find all relevent USRs at a point.
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H_
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H_

#include "clang/Frontend/FrontendAction.h"

namespace clang {
class ASTConsumer;
class CompilerInstance;
class NamedDecl;

namespace rename {

struct USRFindingAction {
  USRFindingAction(unsigned Offset) : SymbolOffset(Offset) {
  }
  std::unique_ptr<ASTConsumer> newASTConsumer();

  // \brief get the spelling of the USR(s) as it would appear in source files.
  const std::string &getUSRSpelling() {
    return SpellingName;
  }

  const std::vector<std::string> &getUSRs() {
    return USRs;
  }

private:
  unsigned SymbolOffset;
  std::string SpellingName;
  std::vector<std::string> USRs;
};

}
}

#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H_
OpenPOWER on IntegriCloud