mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
* Standardize how analysis results/passes as printed with the print() virtual
methods * Eliminate AnalysisID: Now it is just a typedef for const PassInfo* * Simplify how AnalysisID's are initialized * Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into the analyses themselves. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "llvm/InstrTypes.h"
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
|
||||
using analysis::ExprType;
|
||||
|
||||
@@ -154,3 +155,24 @@ InductionVariable::InductionVariable(PHINode *P, LoopInfo *LoopInfo) {
|
||||
// Classify the induction variable type now...
|
||||
InductionType = InductionVariable::Classify(Start, Step, L);
|
||||
}
|
||||
|
||||
void InductionVariable::print(std::ostream &o) const {
|
||||
switch (InductionType) {
|
||||
case InductionVariable::Cannonical: o << "Cannonical "; break;
|
||||
case InductionVariable::SimpleLinear: o << "SimpleLinear "; break;
|
||||
case InductionVariable::Linear: o << "Linear "; break;
|
||||
case InductionVariable::Unknown: o << "Unrecognized "; break;
|
||||
}
|
||||
o << "Induction Variable";
|
||||
if (Phi) {
|
||||
WriteAsOperand(o, Phi);
|
||||
o << ":\n" << Phi;
|
||||
} else {
|
||||
o << "\n";
|
||||
}
|
||||
if (InductionType == InductionVariable::Unknown) return;
|
||||
|
||||
o << " Start ="; WriteAsOperand(o, Start);
|
||||
o << " Step =" ; WriteAsOperand(o, Step);
|
||||
o << "\n";
|
||||
}
|
||||
|
Reference in New Issue
Block a user