summaryrefslogtreecommitdiff
path: root/tools/analyze
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-12-03 17:27:42 +0000
committerChris Lattner <sabre@nondot.org>2001-12-03 17:27:42 +0000
commitdf89f6efbc5d2b40b4997a84ae12ab86baa2d9cb (patch)
tree2a95672a7250e3a73a624e4b7df4db6d745f62f2 /tools/analyze
parentf60dc88b3dc771c8dfbb5c6958666804af2fe032 (diff)
downloadllvm-df89f6efbc5d2b40b4997a84ae12ab86baa2d9cb.tar.gz
llvm-df89f6efbc5d2b40b4997a84ae12ab86baa2d9cb.tar.bz2
llvm-df89f6efbc5d2b40b4997a84ae12ab86baa2d9cb.tar.xz
Induction variables must be phi nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1402 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/analyze')
-rw-r--r--tools/analyze/analyze.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/analyze/analyze.cpp b/tools/analyze/analyze.cpp
index da7de6ec9a..9a53bd45af 100644
--- a/tools/analyze/analyze.cpp
+++ b/tools/analyze/analyze.cpp
@@ -13,6 +13,7 @@
#include "llvm/Instruction.h"
#include "llvm/Module.h"
#include "llvm/Method.h"
+#include "llvm/iPHINode.h"
#include "llvm/Bytecode/Reader.h"
#include "llvm/Assembly/Parser.h"
#include "llvm/Analysis/Writer.h"
@@ -67,11 +68,12 @@ static void PrintClassifiedExprs(Method *M) {
static void PrintInductionVariables(Method *M) {
cfg::LoopInfo LI(M);
for (Method::inst_iterator I = M->inst_begin(), E = M->inst_end();
- I != E; ++I) {
- InductionVariable IV(*I, &LI);
- if (IV.InductionType != InductionVariable::Unknown)
- cout << IV;
- }
+ I != E; ++I)
+ if (PHINode *PN = dyn_cast<PHINode>(*I)) {
+ InductionVariable IV(PN, &LI);
+ if (IV.InductionType != InductionVariable::Unknown)
+ cout << IV;
+ }
}