llvm/llvm/include/llvm/Analysis/DomPrinter.h

//===-- DomPrinter.h - Dom printer external interface ------------*- 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
//
//===----------------------------------------------------------------------===//
//
// This file defines external functions that can be called to explicitly
// instantiate the dominance tree printer.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_ANALYSIS_DOMPRINTER_H
#define LLVM_ANALYSIS_DOMPRINTER_H

#include "llvm/Analysis/DOTGraphTraitsPass.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/IR/Dominators.h"

namespace llvm {

template <>
struct DOTGraphTraits<DomTreeNode *> : public DefaultDOTGraphTraits {};

template <>
struct DOTGraphTraits<DominatorTree *>
    : public DOTGraphTraits<DomTreeNode *> {};

template<>
struct DOTGraphTraits<PostDominatorTree *>
  : public DOTGraphTraits<DomTreeNode*> {};

struct DomViewer final : DOTGraphTraitsViewer<DominatorTreeAnalysis, false> {};

struct DomOnlyViewer final : DOTGraphTraitsViewer<DominatorTreeAnalysis, true> {};

struct PostDomViewer final
    : DOTGraphTraitsViewer<PostDominatorTreeAnalysis, false> {};

struct PostDomOnlyViewer final
    : DOTGraphTraitsViewer<PostDominatorTreeAnalysis, true> {};

struct DomPrinter final : DOTGraphTraitsPrinter<DominatorTreeAnalysis, false> {};

struct DomOnlyPrinter final
    : DOTGraphTraitsPrinter<DominatorTreeAnalysis, true> {};

struct PostDomPrinter final
    : DOTGraphTraitsPrinter<PostDominatorTreeAnalysis, false> {};

struct PostDomOnlyPrinter final
    : DOTGraphTraitsPrinter<PostDominatorTreeAnalysis, true> {};
} // namespace llvm

namespace llvm {
  class FunctionPass;
  FunctionPass *createDomPrinterWrapperPassPass();
  FunctionPass *createDomOnlyPrinterWrapperPassPass();
  FunctionPass *createDomViewerWrapperPassPass();
  FunctionPass *createDomOnlyViewerWrapperPassPass();
  FunctionPass *createPostDomPrinterWrapperPassPass();
  FunctionPass *createPostDomOnlyPrinterWrapperPassPass();
  FunctionPass *createPostDomViewerWrapperPassPass();
  FunctionPass *createPostDomOnlyViewerWrapperPassPass();
} // End llvm namespace

#endif