llvm/llvm/lib/CodeGen/MachineCFGPrinter.cpp

//===- MachineCFGPrinter.cpp - DOT Printer for Machine Functions ----------===//
//
// 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
//
//===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
//
// This file defines the `-dot-machine-cfg` analysis pass, which emits
// Machine Function in DOT format in file titled `<prefix>.<function-name>.dot.
//===----------------------------------------------------------------------===//

#include "llvm/CodeGen/MachineCFGPrinter.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/PassRegistry.h"
#include "llvm/Support/GraphWriter.h"

usingnamespacellvm;

#define DEBUG_TYPE

static cl::opt<std::string>
    MCFGFuncName("mcfg-func-name", cl::Hidden,
                 cl::desc("The name of a function (or its substring)"
                          " whose CFG is viewed/printed."));

static cl::opt<std::string> MCFGDotFilenamePrefix(
    "mcfg-dot-filename-prefix", cl::Hidden,
    cl::desc("The prefix used for the Machine CFG dot file names."));

static cl::opt<bool>
    CFGOnly("dot-mcfg-only", cl::init(false), cl::Hidden,
            cl::desc("Print only the CFG without blocks body"));

static void writeMCFGToDotFile(MachineFunction &MF) {}

namespace {

class MachineCFGPrinter : public MachineFunctionPass {};

} // namespace

char MachineCFGPrinter::ID =;

char &llvm::MachineCFGPrinterID =;

INITIALIZE_PASS()

/// Default construct and initialize the pass.
MachineCFGPrinter::MachineCFGPrinter() :{}

bool MachineCFGPrinter::runOnMachineFunction(MachineFunction &MF) {}