File indexing completed on 2026-05-10 08:37:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_CLANG_TOOLING_REFACTORING_RENAME_USRFINDINGACTION_H
0015 #define LLVM_CLANG_TOOLING_REFACTORING_RENAME_USRFINDINGACTION_H
0016
0017 #include "clang/Basic/LLVM.h"
0018 #include "llvm/ADT/ArrayRef.h"
0019
0020 #include <string>
0021 #include <vector>
0022
0023 namespace clang {
0024 class ASTConsumer;
0025 class ASTContext;
0026 class NamedDecl;
0027
0028 namespace tooling {
0029
0030
0031
0032
0033
0034
0035
0036
0037 const NamedDecl *getCanonicalSymbolDeclaration(const NamedDecl *FoundDecl);
0038
0039
0040 std::vector<std::string> getUSRsForDeclaration(const NamedDecl *ND,
0041 ASTContext &Context);
0042
0043 struct USRFindingAction {
0044 USRFindingAction(ArrayRef<unsigned> SymbolOffsets,
0045 ArrayRef<std::string> QualifiedNames, bool Force)
0046 : SymbolOffsets(SymbolOffsets), QualifiedNames(QualifiedNames),
0047 ErrorOccurred(false), Force(Force) {}
0048 std::unique_ptr<ASTConsumer> newASTConsumer();
0049
0050 ArrayRef<std::string> getUSRSpellings() { return SpellingNames; }
0051 ArrayRef<std::vector<std::string>> getUSRList() { return USRList; }
0052 bool errorOccurred() { return ErrorOccurred; }
0053
0054 private:
0055 std::vector<unsigned> SymbolOffsets;
0056 std::vector<std::string> QualifiedNames;
0057 std::vector<std::string> SpellingNames;
0058 std::vector<std::vector<std::string>> USRList;
0059 bool ErrorOccurred;
0060 bool Force;
0061 };
0062
0063 }
0064 }
0065
0066 #endif