llvm/polly/include/polly/ScopGraphPrinter.h

//===- GraphPrinter.h - Create a DOT output describing the Scop. ----------===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// Create a DOT output describing the Scop.
//
// For each function a dot file is created that shows the control flow graph of
// the function and highlights the detected Scops.
//
//===----------------------------------------------------------------------===//

#ifndef POLLY_SCOP_GRAPH_PRINTER_H
#define POLLY_SCOP_GRAPH_PRINTER_H

#include "polly/ScopDetection.h"
#include "polly/Support/ScopLocation.h"
#include "llvm/Analysis/DOTGraphTraitsPass.h"
#include "llvm/Analysis/RegionInfo.h"
#include "llvm/Analysis/RegionIterator.h"
#include "llvm/Analysis/RegionPrinter.h"
#include "llvm/IR/PassManager.h"

namespace llvm {

template <>
struct GraphTraits<polly::ScopDetection *> : GraphTraits<RegionInfo *> {};

template <>
struct DOTGraphTraits<polly::ScopDetection *> : DOTGraphTraits<RegionNode *> {};
} // end namespace llvm

namespace polly {

struct ScopViewer final : llvm::DOTGraphTraitsViewer<ScopAnalysis, false> {};

struct ScopOnlyViewer final : llvm::DOTGraphTraitsViewer<ScopAnalysis, false> {};

struct ScopPrinter final : llvm::DOTGraphTraitsPrinter<ScopAnalysis, false> {};

struct ScopOnlyPrinter final : llvm::DOTGraphTraitsPrinter<ScopAnalysis, true> {};

} // end namespace polly

#endif /* POLLY_SCOP_GRAPH_PRINTER_H */