]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Tooling/Refactoring/Rename/USRLocFinder.h
MFV r325605: 8713 Buffer overflow in dsl_dataset_name()
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Tooling / Refactoring / Rename / USRLocFinder.h
1 //===--- USRLocFinder.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 functionality for finding all instances of a USR in a given
12 /// AST.
13 ///
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_LOC_FINDER_H
17 #define LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_LOC_FINDER_H
18
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"
23 #include <string>
24 #include <vector>
25
26 namespace clang {
27 namespace tooling {
28
29 /// Create atomic changes for renaming all symbol references which are
30 /// identified by the USRs set to a given new name.
31 ///
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.
35 ///
36 /// \return Atomic changes for renaming.
37 std::vector<tooling::AtomicChange>
38 createRenameAtomicChanges(llvm::ArrayRef<std::string> USRs,
39                           llvm::StringRef NewName, Decl *TranslationUnitDecl);
40
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);
45
46 } // end namespace tooling
47 } // end namespace clang
48
49 #endif // LLVM_CLANG_TOOLING_REFACTOR_RENAME_USR_LOC_FINDER_H