]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Rename/USRFindingAction.h
MFV r326785: 8880 improve DTrace error checking
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Tooling / Refactoring / Rename / USRFindingAction.h
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
31 struct USRFindingAction {
32   USRFindingAction(ArrayRef<unsigned> SymbolOffsets,
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; }
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   bool Force;
49 };
50
51 } // end namespace tooling
52 } // end namespace clang
53
54 #endif // LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDING_ACTION_H