blob: f08c632a01162f5c8c43b10fce1dae861a4da6fa [file] [log] [blame]
Alexander Shaposhnikovbf3c84c2016-09-02 02:56:07 +00001//===-- tools/extra/clang-reorder-fields/ReorderFieldsAction.h -*- C++ -*-===//
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/// This file contains the declarations of the ReorderFieldsAction class and
12/// the FieldPosition struct.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_REORDER_FIELDS_ACTION_H
17#define LLVM_CLANG_TOOLS_EXTRA_CLANG_REORDER_FIELDS_ACTION_H
18
19#include "clang/Tooling/Refactoring.h"
20
21namespace clang {
22class ASTConsumer;
23
24namespace reorder_fields {
25
26class ReorderFieldsAction {
27 llvm::StringRef RecordName;
28 llvm::ArrayRef<std::string> DesiredFieldsOrder;
29 std::map<std::string, tooling::Replacements> &Replacements;
30
31public:
32 ReorderFieldsAction(
33 llvm::StringRef RecordName,
34 llvm::ArrayRef<std::string> DesiredFieldsOrder,
35 std::map<std::string, tooling::Replacements> &Replacements)
36 : RecordName(RecordName), DesiredFieldsOrder(DesiredFieldsOrder),
37 Replacements(Replacements) {}
38
39 ReorderFieldsAction(const ReorderFieldsAction &) = delete;
40 ReorderFieldsAction &operator=(const ReorderFieldsAction &) = delete;
41
42 std::unique_ptr<ASTConsumer> newASTConsumer();
43};
44} // namespace reorder_fields
45} // namespace clang
46
47#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_REORDER_FIELDS_ACTION_H