llvm/clang-tools-extra/clang-reorder-fields/tool/ClangReorderFields.cpp

//===-- tools/extra/clang-reorder-fields/tool/ClangReorderFields.cpp -*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file contains the implementation of clang-reorder-fields tool
///
//===----------------------------------------------------------------------===//

#include "../ReorderFieldsAction.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Refactoring.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include <cstdlib>
#include <string>
#include <system_error>

usingnamespacellvm;
usingnamespaceclang;

cl::OptionCategory ClangReorderFieldsCategory("clang-reorder-fields options");

static cl::opt<std::string>
    RecordName("record-name", cl::Required,
               cl::desc("The name of the struct/class."),
               cl::cat(ClangReorderFieldsCategory));

static cl::list<std::string> FieldsOrder("fields-order", cl::CommaSeparated,
                                         cl::OneOrMore,
                                         cl::desc("The desired fields order."),
                                         cl::cat(ClangReorderFieldsCategory));

static cl::opt<bool> Inplace("i", cl::desc("Overwrite edited files."),
                             cl::cat(ClangReorderFieldsCategory));

const char Usage[] =;

int main(int argc, const char **argv) {}