2014-08-20 09:39:05 +08:00
|
|
|
//===--- tools/extra/clang-rename/RenamingAction.h - Clang rename tool ----===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// \file
|
|
|
|
/// \brief Provides an action to rename every symbol at a point.
|
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2016-08-19 17:36:14 +08:00
|
|
|
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_RENAMING_ACTION_H
|
|
|
|
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_RENAMING_ACTION_H
|
2014-08-20 09:39:05 +08:00
|
|
|
|
|
|
|
#include "clang/Tooling/Refactoring.h"
|
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
class ASTConsumer;
|
|
|
|
class CompilerInstance;
|
|
|
|
|
|
|
|
namespace rename {
|
|
|
|
|
|
|
|
class RenamingAction {
|
|
|
|
public:
|
2016-08-02 17:51:31 +08:00
|
|
|
RenamingAction(const std::vector<std::string> &NewNames,
|
|
|
|
const std::vector<std::string> &PrevNames,
|
|
|
|
const std::vector<std::vector<std::string>> &USRList,
|
2016-08-01 18:16:39 +08:00
|
|
|
std::map<std::string, tooling::Replacements> &FileToReplaces,
|
|
|
|
bool PrintLocations = false)
|
2016-08-02 17:51:31 +08:00
|
|
|
: NewNames(NewNames), PrevNames(PrevNames), USRList(USRList),
|
2016-08-01 18:16:39 +08:00
|
|
|
FileToReplaces(FileToReplaces), PrintLocations(PrintLocations) {}
|
2014-08-20 09:39:05 +08:00
|
|
|
|
|
|
|
std::unique_ptr<ASTConsumer> newASTConsumer();
|
|
|
|
|
|
|
|
private:
|
2016-08-02 17:51:31 +08:00
|
|
|
const std::vector<std::string> &NewNames, &PrevNames;
|
|
|
|
const std::vector<std::vector<std::string>> &USRList;
|
2016-08-01 18:16:39 +08:00
|
|
|
std::map<std::string, tooling::Replacements> &FileToReplaces;
|
2014-08-20 09:39:05 +08:00
|
|
|
bool PrintLocations;
|
|
|
|
};
|
2016-09-05 17:42:02 +08:00
|
|
|
|
|
|
|
} // namespace rename
|
|
|
|
} // namespace clang
|
2014-08-20 09:39:05 +08:00
|
|
|
|
2016-08-19 17:36:14 +08:00
|
|
|
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_RENAME_RENAMING_ACTION_H
|