From 66d9ceaaba94e31365008ae04149e6d8c2a324f8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 3 Dec 2001 17:27:42 +0000 Subject: Induction variables must be phi nodes llvm-svn: 1402 --- llvm/tools/analyze/analyze.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'llvm/tools/analyze/analyze.cpp') diff --git a/llvm/tools/analyze/analyze.cpp b/llvm/tools/analyze/analyze.cpp index da7de6ec9af..9a53bd45af1 100644 --- a/llvm/tools/analyze/analyze.cpp +++ b/llvm/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(*I)) { + InductionVariable IV(PN, &LI); + if (IV.InductionType != InductionVariable::Unknown) + cout << IV; + } } -- cgit v1.2.3