2011-04-29 14:27:02 +08:00
|
|
|
//===- ScopPass.cpp - The base class of Passes that operate on Polly IR ---===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the definitions of the ScopPass members.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "polly/ScopPass.h"
|
|
|
|
#include "polly/ScopInfo.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
using namespace polly;
|
|
|
|
|
|
|
|
bool ScopPass::runOnRegion(Region *R, RGPassManager &RGM) {
|
2014-11-14 19:12:31 +08:00
|
|
|
S = nullptr;
|
2011-04-29 14:27:02 +08:00
|
|
|
|
2016-05-31 17:41:04 +08:00
|
|
|
if ((S = getAnalysis<ScopInfoRegionPass>().getScop()))
|
2011-04-29 14:27:02 +08:00
|
|
|
return runOnScop(*S);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScopPass::print(raw_ostream &OS, const Module *M) const {
|
|
|
|
if (S)
|
2015-03-02 02:40:25 +08:00
|
|
|
printScop(OS, *S);
|
2011-04-29 14:27:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScopPass::getAnalysisUsage(AnalysisUsage &AU) const {
|
2016-05-31 17:41:04 +08:00
|
|
|
AU.addRequired<ScopInfoRegionPass>();
|
2011-04-29 14:27:02 +08:00
|
|
|
AU.setPreservesAll();
|
|
|
|
}
|