4 #include "genericDataflowCommon.h"
5 #include "VirtualCFGIterator.h"
7 #include "CallGraphTraverse.h"
8 #include "analysisCommon.h"
11 #include "latticeFull.h"
12 #include "liveDeadVarAnalysis.h"
13 #include "printAnalysisStates.h"
14 #include "VariableStateTransfer.h"
20 extern int divAnalysisDebugLevel;
39 static const int bottom=1;
41 static const int valKnown=2;
43 static const int divKnown=3;
45 static const int top=4;
77 this->value = that.value;
80 this->level = that.level;
94 static bool matchDiv(
long value,
long div,
long rem);
109 bool meetUpdate(
Lattice* that);
114 bool operator==(
Lattice* that);
121 long getValue()
const;
124 short getLevel()
const;
132 bool set(
long value);
136 bool set(
long div,
long rem);
144 bool incr(
long increment);
148 bool mult(
long multiplier);
150 std::string str(std::string indent=
"");
156 void visitIntegerValue(T *sgn);
161 template <
typename T>
162 void transferArith(
SgBinaryOp *sgn, T transferOp);
163 void transferArith(
SgBinaryOp *sgn, TransferOp transferOp);
164 void transferAdditive(DivLattice *arg1Lat, DivLattice *arg2Lat, DivLattice *resLat,
bool isAddition);
165 void transferMultiplicative(DivLattice *arg1Lat, DivLattice *arg2Lat, DivLattice *resLat);
166 void transferDivision(DivLattice *arg1Lat, DivLattice *arg2Lat, DivLattice *resLat);
167 void transferMod(DivLattice *arg1Lat, DivLattice *arg2Lat, DivLattice *resLat);
194 bool finish() {
return modified; }
202 static std::map<varID, Lattice*> constVars;
203 static bool constVars_init;
224 std::vector<Lattice*>& initLattices, std::vector<NodeFact*>& initFacts);
232 { assert(0);
return false; }
233 boost::shared_ptr<IntraDFTransferVisitor> getTransferVisitor(
const Function& func,
const DataflowNode& n,
234 NodeState& state,
const std::vector<Lattice*>& dfInfo)
235 {
return boost::shared_ptr<IntraDFTransferVisitor>(
new DivAnalysisTransfer(func, n, state, dfInfo)); }
239 void printDivAnalysisStates(
DivAnalysis* da, std::string indent=
"");
This class represents the notion of a binary operator. It is derived from a SgExpression because oper...
This class represents the notion of a unary operator. It is derived from a SgExpression because opera...
This class represents the notion of an value (expression value).
This class represents the numeric negation of a value. Not to be confused with SgSubtractOp.