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 /// \brief 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 "llvm/ADT/StringRef.h"
29 /// Create atomic changes for renaming all symbol references which are
30 /// identified by the USRs set to a given new name.
32 /// \param USRs The set containing USRs of a particular old symbol.
33 /// \param NewName The new name to replace old symbol name.
34 /// \param TranslationUnitDecl The translation unit declaration.
36 /// \return Atomic changes for renaming.
37 std::vector<tooling::AtomicChange>
38 createRenameAtomicChanges(llvm::ArrayRef<std::string> USRs,
39 llvm::StringRef NewName, Decl *TranslationUnitDecl);
41 // FIXME: make this an AST matcher. Wouldn't that be awesome??? I agree!
42 std::vector<SourceLocation>
43 getLocationsOfUSRs(const std::vector<std::string> &USRs,
44 llvm::StringRef PrevName, Decl *Decl);
46 } // end namespace tooling
47 } // end namespace clang
49 #endif // LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_LOC_FINDER_H