#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) { … }
}
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) { … }