1 //===--- USRLocFinder.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 /// Provides functionality for finding all instances of a USR in a given
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_LOC_FINDER_H
17 #define LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_LOC_FINDER_H
19 #include "clang/AST/AST.h"
20 #include "clang/Tooling/Core/Replacement.h"
21 #include "clang/Tooling/Refactoring/AtomicChange.h"
22 #include "clang/Tooling/Refactoring/Rename/SymbolOccurrences.h"
23 #include "llvm/ADT/StringRef.h"
30 /// Create atomic changes for renaming all symbol references which are
31 /// identified by the USRs set to a given new name.
33 /// \param USRs The set containing USRs of a particular old symbol.
34 /// \param NewName The new name to replace old symbol name.
35 /// \param TranslationUnitDecl The translation unit declaration.
37 /// \return Atomic changes for renaming.
38 std::vector<tooling::AtomicChange>
39 createRenameAtomicChanges(llvm::ArrayRef<std::string> USRs,
40 llvm::StringRef NewName, Decl *TranslationUnitDecl);
42 /// Finds the symbol occurrences for the symbol that's identified by the given
45 /// \return SymbolOccurrences that can be converted to AtomicChanges when
47 SymbolOccurrences getOccurrencesOfUSRs(ArrayRef<std::string> USRs,
48 StringRef PrevName, Decl *Decl);
50 } // end namespace tooling
51 } // end namespace clang
53 #endif // LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_LOC_FINDER_H