diff options
| author | Chris Lattner <sabre@nondot.org> | 2001-12-03 17:27:42 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2001-12-03 17:27:42 +0000 |
| commit | 66d9ceaaba94e31365008ae04149e6d8c2a324f8 (patch) | |
| tree | 27fbb58eb4704f1674285b5eab1392acbf2a02d5 /llvm/tools/analyze/analyze.cpp | |
| parent | b4c677745e94fc750c795de2f2b662f9391dd22b (diff) | |
| download | bcm5719-llvm-66d9ceaaba94e31365008ae04149e6d8c2a324f8.tar.gz bcm5719-llvm-66d9ceaaba94e31365008ae04149e6d8c2a324f8.zip | |
Induction variables must be phi nodes
llvm-svn: 1402
Diffstat (limited to 'llvm/tools/analyze/analyze.cpp')
| -rw-r--r-- | llvm/tools/analyze/analyze.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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<PHINode>(*I)) { + InductionVariable IV(PN, &LI); + if (IV.InductionType != InductionVariable::Unknown) + cout << IV; + } } |

