diff options
Diffstat (limited to 'polly/lib/Analysis/ScopPass.cpp')
| -rwxr-xr-x | polly/lib/Analysis/ScopPass.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopPass.cpp b/polly/lib/Analysis/ScopPass.cpp new file mode 100755 index 00000000000..9244db34a38 --- /dev/null +++ b/polly/lib/Analysis/ScopPass.cpp @@ -0,0 +1,42 @@ +//===- 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) { + S = 0; + + if ((S = getAnalysis<ScopInfo>().getScop())) + return runOnScop(*S); + + return false; +} + +isl_ctx *ScopPass::getIslContext() { + assert(S && "Not in on a Scop!"); + return S->getCtx(); +} + +void ScopPass::print(raw_ostream &OS, const Module *M) const { + if (S) + printScop(OS); +} + +void ScopPass::getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired<ScopInfo>(); + AU.setPreservesAll(); +} |

