[SE] Make Kernel movable
[lldb.git] / clang-tools-extra / clang-reorder-fields / ReorderFieldsAction.h
1 //===-- 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
21 namespace clang {
22 class ASTConsumer;
23
24 namespace reorder_fields {
25
26 class ReorderFieldsAction {
27   llvm::StringRef RecordName;
28   llvm::ArrayRef<std::string> DesiredFieldsOrder;
29   std::map<std::string, tooling::Replacements> &Replacements;
30
31 public:
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