1 //===--- USRFindingAction.h - Clang refactoring library -------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief Provides an action to find all relevant USRs at a point.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDING_ACTION_H
16 #define LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDING_ACTION_H
18 #include "clang/Basic/LLVM.h"
19 #include "llvm/ADT/ArrayRef.h"
26 class CompilerInstance;
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();
38 ArrayRef<std::string> getUSRSpellings() { return SpellingNames; }
39 ArrayRef<std::vector<std::string>> getUSRList() { return USRList; }
40 bool errorOccurred() { return ErrorOccurred; }
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;
51 } // end namespace tooling
52 } // end namespace clang
54 #endif // LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_FINDING_ACTION_H