llvm/llvm/lib/Analysis/DomPrinter.cpp

//===- DomPrinter.cpp - DOT printer for the dominance trees    ------------===//
//
// 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 '-dot-dom' and '-dot-postdom' analysis passes, which emit
// a dom.<fnname>.dot or postdom.<fnname>.dot file for each function in the
// program, with a graph of the dominance/postdominance tree of that
// function.
//
// There are also passes available to directly call dotty ('-view-dom' or
// '-view-postdom'). By appending '-only' like '-dot-dom-only' only the
// names of the bbs are printed, but the content is hidden.
//
//===----------------------------------------------------------------------===//

#include "llvm/Analysis/DomPrinter.h"
#include "llvm/Analysis/DOTGraphTraitsPass.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/InitializePasses.h"

usingnamespacellvm;


void DominatorTree::viewGraph(const Twine &Name, const Twine &Title) {}

void DominatorTree::viewGraph() {}

namespace {
struct LegacyDominatorTreeWrapperPassAnalysisGraphTraits {};

struct DomViewerWrapperPass
    : public DOTGraphTraitsViewerWrapperPass<
          DominatorTreeWrapperPass, false, DominatorTree *,
          LegacyDominatorTreeWrapperPassAnalysisGraphTraits> {};

struct DomOnlyViewerWrapperPass
    : public DOTGraphTraitsViewerWrapperPass<
          DominatorTreeWrapperPass, true, DominatorTree *,
          LegacyDominatorTreeWrapperPassAnalysisGraphTraits> {};

struct LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits {};

struct PostDomViewerWrapperPass
    : public DOTGraphTraitsViewerWrapperPass<
          PostDominatorTreeWrapperPass, false, PostDominatorTree *,
          LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> {};

struct PostDomOnlyViewerWrapperPass
    : public DOTGraphTraitsViewerWrapperPass<
          PostDominatorTreeWrapperPass, true, PostDominatorTree *,
          LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> {};
} // end anonymous namespace

char DomViewerWrapperPass::ID =;
INITIALIZE_PASS()

char DomOnlyViewerWrapperPass::ID =;
INITIALIZE_PASS()

char PostDomViewerWrapperPass::ID =;
INITIALIZE_PASS()

char PostDomOnlyViewerWrapperPass::ID =;
INITIALIZE_PASS()

namespace {
struct DomPrinterWrapperPass
    : public DOTGraphTraitsPrinterWrapperPass<
          DominatorTreeWrapperPass, false, DominatorTree *,
          LegacyDominatorTreeWrapperPassAnalysisGraphTraits> {};

struct DomOnlyPrinterWrapperPass
    : public DOTGraphTraitsPrinterWrapperPass<
          DominatorTreeWrapperPass, true, DominatorTree *,
          LegacyDominatorTreeWrapperPassAnalysisGraphTraits> {};

struct PostDomPrinterWrapperPass
    : public DOTGraphTraitsPrinterWrapperPass<
          PostDominatorTreeWrapperPass, false, PostDominatorTree *,
          LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> {};

struct PostDomOnlyPrinterWrapperPass
    : public DOTGraphTraitsPrinterWrapperPass<
          PostDominatorTreeWrapperPass, true, PostDominatorTree *,
          LegacyPostDominatorTreeWrapperPassAnalysisGraphTraits> {};
} // end anonymous namespace

char DomPrinterWrapperPass::ID =;
INITIALIZE_PASS()

char DomOnlyPrinterWrapperPass::ID =;
INITIALIZE_PASS()

char PostDomPrinterWrapperPass::ID =;
INITIALIZE_PASS()

char PostDomOnlyPrinterWrapperPass::ID =;
INITIALIZE_PASS()

// Create methods available outside of this file, to use them
// "include/llvm/LinkAllPasses.h". Otherwise the pass would be deleted by
// the link time optimization.

FunctionPass *llvm::createDomPrinterWrapperPassPass() {}

FunctionPass *llvm::createDomOnlyPrinterWrapperPassPass() {}

FunctionPass *llvm::createDomViewerWrapperPassPass() {}

FunctionPass *llvm::createDomOnlyViewerWrapperPassPass() {}

FunctionPass *llvm::createPostDomPrinterWrapperPassPass() {}

FunctionPass *llvm::createPostDomOnlyPrinterWrapperPassPass() {}

FunctionPass *llvm::createPostDomViewerWrapperPassPass() {}

FunctionPass *llvm::createPostDomOnlyViewerWrapperPassPass() {}