clang-tools  4.0.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/Basic/LLVM.h"
19 #include "llvm/ADT/ArrayRef.h"
20 
21 #include <string>
22 #include <vector>
23 
24 namespace clang {
25 class ASTConsumer;
26 class CompilerInstance;
27 class NamedDecl;
28 
29 namespace rename {
30 
32  USRFindingAction(ArrayRef<unsigned> SymbolOffsets,
33  ArrayRef<std::string> QualifiedNames)
34  : SymbolOffsets(SymbolOffsets), QualifiedNames(QualifiedNames),
35  ErrorOccurred(false) {}
36  std::unique_ptr<ASTConsumer> newASTConsumer();
37 
38  ArrayRef<std::string> getUSRSpellings() { return SpellingNames; }
39  ArrayRef<std::vector<std::string>> getUSRList() { return USRList; }
40  bool errorOccurred() { return ErrorOccurred; }
41 
42 private:
43  std::vector<unsigned> SymbolOffsets;
44  std::vector<std::string> QualifiedNames;
45  std::vector<std::string> SpellingNames;
46  std::vector<std::vector<std::string>> USRList;
47  bool ErrorOccurred;
48 };
49 
50 } // namespace rename
51 } // namespace clang
52 
53 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_USR_FINDING_ACTION_H
ArrayRef< std::vector< std::string > > getUSRList()
std::unique_ptr< ASTConsumer > newASTConsumer()
ArrayRef< std::string > getUSRSpellings()
USRFindingAction(ArrayRef< unsigned > SymbolOffsets, ArrayRef< std::string > QualifiedNames)