llvm/polly/lib/Analysis/ScopGraphPrinter.cpp

//===- GraphPrinter.cpp - 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.
//
//===----------------------------------------------------------------------===//

#include "polly/ScopGraphPrinter.h"
#include "polly/LinkAllPasses.h"
#include "polly/ScopDetection.h"
#include "llvm/Support/CommandLine.h"

usingnamespacepolly;
usingnamespacellvm;
static cl::opt<std::string>
    ViewFilter("polly-view-only",
               cl::desc("Only view functions that match this pattern"),
               cl::Hidden, cl::init(""));

static cl::opt<bool> ViewAll("polly-view-all",
                             cl::desc("Also show functions without any scops"),
                             cl::Hidden, cl::init(false));

namespace llvm {

std::string DOTGraphTraits<ScopDetection *>::getEdgeAttributes(
    RegionNode *srcNode, GraphTraits<RegionInfo *>::ChildIteratorType CI,
    ScopDetection *SD) {}

std::string
DOTGraphTraits<ScopDetection *>::escapeString(llvm::StringRef String) {}

void DOTGraphTraits<ScopDetection *>::printRegionCluster(ScopDetection *SD,
                                                         const Region *R,
                                                         raw_ostream &O,
                                                         unsigned depth) {}

void DOTGraphTraits<ScopDetection *>::addCustomGraphFeatures(
    ScopDetection *SD, GraphWriter<ScopDetection *> &GW) {}

} // namespace llvm

struct ScopDetectionAnalysisGraphTraits {};

struct ScopViewerWrapperPass
    : DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
                                      ScopDetection *,
                                      ScopDetectionAnalysisGraphTraits> {};
char ScopViewerWrapperPass::ID =;

struct ScopOnlyViewerWrapperPass
    : DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
                                      ScopDetection *,
                                      ScopDetectionAnalysisGraphTraits> {};
char ScopOnlyViewerWrapperPass::ID =;

struct ScopPrinterWrapperPass
    : DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, false,
                                       ScopDetection *,
                                       ScopDetectionAnalysisGraphTraits> {};
char ScopPrinterWrapperPass::ID =;

struct ScopOnlyPrinterWrapperPass
    : DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, true,
                                       ScopDetection *,
                                       ScopDetectionAnalysisGraphTraits> {};
char ScopOnlyPrinterWrapperPass::ID =;

static RegisterPass<ScopViewerWrapperPass> X("view-scops",
                                             "Polly - View Scops of function");

static RegisterPass<ScopOnlyViewerWrapperPass>
    Y("view-scops-only",
      "Polly - View Scops of function (with no function bodies)");

static RegisterPass<ScopPrinterWrapperPass>
    M("dot-scops", "Polly - Print Scops of function");

static RegisterPass<ScopOnlyPrinterWrapperPass>
    N("dot-scops-only",
      "Polly - Print Scops of function (with no function bodies)");

Pass *polly::createDOTViewerWrapperPass() {}

Pass *polly::createDOTOnlyViewerWrapperPass() {}

Pass *polly::createDOTPrinterWrapperPass() {}

Pass *polly::createDOTOnlyPrinterWrapperPass() {}

bool ScopViewer::processFunction(Function &F, const ScopDetection &SD) {}