clang  5.0.0
USRFindingAction.h
Go to the documentation of this file.
1 //===--- USRFindingAction.h - Clang refactoring library -------------------===//
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_TOOLING_REFACTOR_RENAME_USR_FINDING_ACTION_H
16 #define LLVM_CLANG_TOOLING_REFACTOR_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 tooling {
30 
33  ArrayRef<std::string> QualifiedNames, bool Force)
34  : SymbolOffsets(SymbolOffsets), QualifiedNames(QualifiedNames),
35  ErrorOccurred(false), Force(Force) {}
36  std::unique_ptr<ASTConsumer> newASTConsumer();
37 
38  ArrayRef<std::string> getUSRSpellings() { return SpellingNames; }
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  bool Force;
49 };
50 
51 } // end namespace tooling
52 } // end namespace clang
53 
54 #endif // LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDING_ACTION_H
USRFindingAction(ArrayRef< unsigned > SymbolOffsets, ArrayRef< std::string > QualifiedNames, bool Force)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
#define false
Definition: stdbool.h:33
ArrayRef< std::string > getUSRSpellings()
std::unique_ptr< ASTConsumer > newASTConsumer()
ArrayRef< std::vector< std::string > > getUSRList()