aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LoopDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorAndreas Bolka <a@bolka.at>2009-06-28 00:16:08 +0000
committerAndreas Bolka <a@bolka.at>2009-06-28 00:16:08 +0000
commit707207adaed969c32a09ae873ac5a171b3744617 (patch)
treec090688cb43db1c7611c47bd36d025da8d3d4ed3 /lib/Analysis/LoopDependenceAnalysis.cpp
parentf7ca1611e22d7b877ecfd444841f8c79deb5f9e4 (diff)
LDA analysis output scaffolding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopDependenceAnalysis.cpp')
-rw-r--r--lib/Analysis/LoopDependenceAnalysis.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/Analysis/LoopDependenceAnalysis.cpp b/lib/Analysis/LoopDependenceAnalysis.cpp
index 172a2be6bc..8f3e6baf5c 100644
--- a/lib/Analysis/LoopDependenceAnalysis.cpp
+++ b/lib/Analysis/LoopDependenceAnalysis.cpp
@@ -43,5 +43,23 @@ bool LoopDependenceAnalysis::runOnLoop(Loop *L, LPPassManager &) {
void LoopDependenceAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
- AU.addRequired<ScalarEvolution>();
+ AU.addRequiredTransitive<ScalarEvolution>();
+}
+
+static void PrintLoopInfo(
+ raw_ostream &OS, const LoopDependenceAnalysis *LDA, const Loop *L) {
+ if (!L->empty()) return; // ignore non-innermost loops
+
+ OS << "Loop at depth " << L->getLoopDepth() << ", header block: ";
+ WriteAsOperand(OS, L->getHeader(), false);
+ OS << "\n";
+}
+
+void LoopDependenceAnalysis::print(raw_ostream &OS, const Module*) const {
+ PrintLoopInfo(OS, this, this->L);
+}
+
+void LoopDependenceAnalysis::print(std::ostream &OS, const Module *M) const {
+ raw_os_ostream os(OS);
+ print(os, M);
}