clang-tools  3.9.0
RenamingAction.h
Go to the documentation of this file.
1 //===--- tools/extra/clang-rename/RenamingAction.h - Clang rename tool ----===//
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 an action to rename every symbol at a point.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_RENAMING_ACTION_H_
16 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_RENAMING_ACTION_H_
17 
18 #include "clang/Tooling/Refactoring.h"
19 
20 namespace clang {
21 class ASTConsumer;
22 class CompilerInstance;
23 
24 namespace rename {
25 
27 public:
28  RenamingAction(const std::string &NewName, const std::string &PrevName,
29  const std::vector<std::string> &USRs,
30  tooling::Replacements &Replaces, bool PrintLocations = false)
31  : NewName(NewName), PrevName(PrevName), USRs(USRs), Replaces(Replaces),
32  PrintLocations(PrintLocations) {
33  }
34 
35  std::unique_ptr<ASTConsumer> newASTConsumer();
36 
37 private:
38  const std::string &NewName, &PrevName;
39  const std::vector<std::string> &USRs;
40  tooling::Replacements &Replaces;
41  bool PrintLocations;
42 };
43 
44 }
45 }
46 
47 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_RENAMING_ACTION_H_
RenamingAction(const std::string &NewName, const std::string &PrevName, const std::vector< std::string > &USRs, tooling::Replacements &Replaces, bool PrintLocations=false)
std::unique_ptr< ASTConsumer > newASTConsumer()