Exp Class Reference

#include <include/exp.h>

Inheritance diagram for Exp:

Const Terminal Unary TypeVal Binary FlagDef Location RefExp TypedExp Ternary List of all members.

Detailed Description

Definition at line 76 of file exp.h.

Public Member Functions

virtual Expaccept (ExpModifier *v)=0
virtual bool accept (ExpVisitor *v)=0
void addUsedLocs (LocationSet &used, bool memOnly=false)
virtual void appendDotFile (std::ofstream &os)=0
virtual TypeascendType ()
Expbypass ()
void bypassComp ()
virtual Expclone ()=0
bool containsBadMemof (UserProc *p)
bool containsFlags ()
bool containsMemof (UserProc *proc)
void createDotFile (char *name)
virtual void descendType (Type *parentType, bool &ch, Statement *s)
virtual void doSearchChildren (Exp *search, std::list< Exp ** > &li, bool once)
void dump ()
ExpexpSubscriptAllNull ()
ExpexpSubscriptValNull (Exp *e)
ExpexpSubscriptVar (Exp *e, Statement *def)
UserProcfindProc ()
void fixLocationProc (UserProc *p)
ExpfixSuccessor ()
ExpfromSSAleft (UserProc *proc, Statement *d)
virtual ExpgenConstraints (Exp *result)
char * getAnyStrConst ()
virtual int getArity ()
int getComplexityDepth (UserProc *proc)
ExpgetGuard ()
unsigned getLexBegin ()
unsigned getLexEnd ()
int getMemDepth ()
virtual int getNumRefs ()
OPER getOper () const
virtual ExpgetSubExp1 ()
virtual ExpgetSubExp2 ()
virtual ExpgetSubExp3 ()
int getVarIndex ()
bool isAddrOf ()
bool isAfpTerm ()
bool isAnull ()
bool isArrayIndex ()
bool isBoolConst ()
bool isComparison ()
bool isConjunction ()
bool isConst ()
bool isDisjunction ()
bool isEquality ()
bool isFalse ()
bool isFlagCall ()
bool isFlags ()
bool isFltConst ()
bool isGlobal ()
bool isIntConst ()
bool isLocal ()
bool isLocation ()
bool isMachFtr ()
bool isMainFlag ()
bool isMemberOf ()
bool isMemOf ()
bool isNil ()
bool isParam ()
bool isPC ()
bool isPostVar ()
bool isRegN (int n)
bool isRegOf ()
bool isRegOfK ()
bool isSizeCast ()
bool isStrConst ()
bool isSubscript ()
bool isTemp ()
virtual bool isTerminal ()
bool isTrue ()
bool isTypedExp ()
bool isTypeOf ()
bool isTypeVal ()
ExpkillFill ()
virtual bool match (const char *pattern, std::map< std::string, Exp * > &bindings)
virtual Expmatch (Exp *pattern)
virtual bool operator *= (Exp &o)=0
virtual bool operator< (const Exp &o) const =0
virtual bool operator<< (const Exp &o) const
virtual bool operator== (const Exp &o) const =0
void partitionTerms (std::list< Exp * > &positives, std::list< Exp * > &negatives, std::vector< int > &integers, bool negate)
virtual ExppolySimplify (bool &bMod)
virtual void print (std::ostream &os, bool html=false)=0
void printAsHL (std::ostream &os=std::cout)
virtual void printr (std::ostream &os, bool html=false)
char * prints ()
void printt (std::ostream &os=std::cout)
virtual void printx (int ind)=0
ExppropagateAll ()
 Propagate all possible assignments to components of this expression.
ExppropagateAllRpt (bool &changed)
virtual Exp *& refSubExp1 ()
virtual Exp *& refSubExp2 ()
virtual Exp *& refSubExp3 ()
ExpremoveSubscripts (bool &allZero)
virtual bool search (Exp *search, Exp *&result)
bool searchAll (Exp *search, std::list< Exp * > &result)
ExpsearchReplace (Exp *search, Exp *replace, bool &change)
ExpsearchReplaceAll (Exp *search, Exp *replace, bool &change, bool once=false)
void setConscripts (int n, bool bClear)
void setLexBegin (unsigned int n)
void setLexEnd (unsigned int n)
void setOper (OPER x)
virtual void setSubExp1 (Exp *e)
virtual void setSubExp2 (Exp *e)
virtual void setSubExp3 (Exp *e)
Expsimplify ()
virtual ExpsimplifyAddr ()
virtual ExpsimplifyArith ()
virtual ExpsimplifyConstraint ()
ExpstripSizes ()
virtual ~Exp ()

Static Public Member Functions

static ExpAccumulate (std::list< Exp * > exprs)
static void doSearch (Exp *search, Exp *&pSrc, std::list< Exp ** > &li, bool once)

Protected Member Functions

 Exp (OPER op)

Protected Attributes

unsigned lexBegin
unsigned lexEnd
OPER op

Friends

class XMLProgParser


Constructor & Destructor Documentation

Exp::Exp OPER  op  )  [inline, protected]
 

Definition at line 83 of file exp.h.

virtual Exp::~Exp  )  [inline, virtual]
 

Definition at line 87 of file exp.h.


Member Function Documentation

virtual Exp* Exp::accept ExpModifier v  )  [pure virtual]
 

Implemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, FlagDef, RefExp, TypeVal, and Location.

virtual bool Exp::accept ExpVisitor v  )  [pure virtual]
 

Implemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, FlagDef, RefExp, TypeVal, and Location.

Referenced by ImpRefStatement::accept(), BoolAssign::accept(), CallStatement::accept(), CaseStatement::accept(), BranchStatement::accept(), GotoStatement::accept(), ImplicitAssign::accept(), PhiAssign::accept(), Assign::accept(), Location::accept(), RefExp::accept(), FlagDef::accept(), TypedExp::accept(), Ternary::accept(), Binary::accept(), Unary::accept(), addUsedLocs(), bypass(), StmtSsaXformer::commonLhs(), containsBadMemof(), containsFlags(), containsMemof(), expSubscriptVar(), findProc(), fixLocationProc(), getComplexityDepth(), getMemDepth(), CallStatement::localiseExp(), UserProc::makeParamsImplicit(), propagateAll(), propagateAllRpt(), UserProc::removeRedundantParameters(), setConscripts(), stripSizes(), StmtSsaXformer::visit(), StmtImplicitConverter::visit(), StmtSubscripter::visit(), UsedLocsVisitor::visit(), UsedLocsFinder::visit(), and StmtConscriptSetter::visit().

Exp * Exp::Accumulate std::list< Exp * >  exprs  )  [static]
 

Definition at line 1855 of file exp.cpp.

References opPlus.

Referenced by ExpTest::testAccumulate(), and ExpTest::testPartitionTerms().

void Exp::addUsedLocs LocationSet used,
bool  memOnly = false
 

Definition at line 3846 of file exp.cpp.

References accept().

Referenced by UserProc::checkForGainfulUse(), PentiumFrontEnd::processOverlapped(), Statement::propagateTo(), removeSubscripts(), DataFlow::renameBlockVars(), and ExpTest::testAddUsedLocs().

virtual void Exp::appendDotFile std::ofstream &  os  )  [pure virtual]
 

Implemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, and FlagDef.

Referenced by FlagDef::appendDotFile(), TypedExp::appendDotFile(), Ternary::appendDotFile(), Binary::appendDotFile(), Unary::appendDotFile(), and createDotFile().

virtual Type* Exp::ascendType  )  [inline, virtual]
 

Reimplemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, and RefExp.

Definition at line 360 of file exp.h.

Referenced by Unary::ascendType(), Binary::ascendType(), checkSignedness(), Binary::descendType(), and Assign::dfaTypeAnalysis().

Exp * Exp::bypass  ) 
 

Definition at line 3877 of file exp.cpp.

References accept(), and NULL.

Referenced by bypassComp(), and Localiser::postVisit().

void Exp::bypassComp  ) 
 

Definition at line 3882 of file exp.cpp.

References bypass(), getSubExp1(), and opMemOf.

virtual Exp* Exp::clone  )  [pure virtual]
 

Implemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, RefExp, TypeVal, and Location.

Referenced by Assign::Assign(), Binary::Binary(), PostTestedLoopSyntaxNode::clone(), PretestedLoopSyntaxNode::clone(), IfThenElseSyntaxNode::clone(), IfThenSyntaxNode::clone(), ImpRefStatement::clone(), Assign::clone(), BoolAssign::clone(), CallStatement::clone(), CaseStatement::clone(), BranchStatement::clone(), GotoStatement::clone(), Return::clone(), Parameter::clone(), Location::clone(), RefExp::clone(), TypedExp::clone(), Ternary::clone(), Binary::clone(), Unary::clone(), condToRelational(), ArgSourceProvider::exists(), LocationSet::findDifferentRef(), UserProc::findFinalParameters(), Cfg::findImplicitAssign(), UserProc::fixCallAndPhiRefs(), fixSuccessor(), genBSFR(), Assign::genConstraints(), BoolAssign::generateCode(), BasicBlock::generateCode(), BasicBlock::getLiveOut(), UserProc::insertParameter(), CallStatement::localiseExp(), CallStatement::makeArgAssign(), UserProc::mapExpressionsToLocals(), UserProc::mapParameters(), match(), ArgSourceProvider::nextArgLoc(), ExpPropagator::postVisit(), Localiser::postVisit(), UserProc::prover(), BranchStatement::rangeAnalysis(), Assign::rangeAnalysis(), DataFlow::renameBlockVars(), searchReplaceAll(), CallStatement::setArgumentExp(), UserProc::setPremise(), simplify(), RangeMap::substInto(), Ternary::Ternary(), StatementTest::testBypass(), ExpTest::testSubscriptVar(), ExpTest::testSubscriptVars(), TypedExp::TypedExp(), Unary::Unary(), and CallStatement::updateArguments().

bool Exp::containsBadMemof UserProc p  ) 
 

Definition at line 3929 of file exp.cpp.

References accept(), and BadMemofFinder::isFound().

Referenced by Statement::propagateTo().

bool Exp::containsFlags  ) 
 

Definition at line 3921 of file exp.cpp.

References accept(), and FlagsFinder::isFound().

Referenced by ExpTest::testVisitors().

bool Exp::containsMemof UserProc proc  ) 
 

Definition at line 3936 of file exp.cpp.

References accept(), and ExpHasMemofTester::getResult().

void Exp::createDotFile char *  name  ) 
 

Definition at line 1063 of file exp.cpp.

References appendDotFile(), and LOG.

virtual void Exp::descendType Type parentType,
bool &  ch,
Statement s
[inline, virtual]
 

Reimplemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, and RefExp.

Definition at line 362 of file exp.h.

Referenced by Ternary::descendType(), Unary::descendType(), RefExp::descendType(), BranchStatement::dfaTypeAnalysis(), and Assign::dfaTypeAnalysis().

void Exp::doSearch Exp search,
Exp *&  pSrc,
std::list< Exp ** > &  li,
bool  once
[static]
 

Definition at line 1542 of file exp.cpp.

References doSearchChildren(), op, opSubscript, and search().

Referenced by PentiumFrontEnd::bumpRegisterAll(), Ternary::doSearchChildren(), Binary::doSearchChildren(), Unary::doSearchChildren(), killFill(), search(), searchAll(), and searchReplaceAll().

void Exp::doSearchChildren Exp search,
std::list< Exp ** > &  li,
bool  once
[virtual]
 

Reimplemented in Unary, Binary, and Ternary.

Definition at line 1566 of file exp.cpp.

Referenced by doSearch().

void Exp::dump  ) 
 

Definition at line 1051 of file exp.cpp.

References print().

Exp * Exp::expSubscriptAllNull  ) 
 

Definition at line 3864 of file exp.cpp.

References expSubscriptVar(), and NULL.

Referenced by UserProc::removeRedundantParameters().

Exp * Exp::expSubscriptValNull Exp e  ) 
 

Definition at line 3859 of file exp.cpp.

References expSubscriptVar(), and NULL.

Exp * Exp::expSubscriptVar Exp e,
Statement def
 

Definition at line 3852 of file exp.cpp.

References accept().

Referenced by expSubscriptAllNull(), expSubscriptValNull(), and ExpTest::testSubscriptVars().

UserProc * Exp::findProc  ) 
 

Definition at line 3668 of file exp.cpp.

References accept(), and GetProcVisitor::getProc().

void Exp::fixLocationProc UserProc p  ) 
 

Definition at line 3657 of file exp.cpp.

References accept(), and FixProcVisitor::setProc().

Exp * Exp::fixSuccessor  ) 
 

Definition at line 3068 of file exp.cpp.

References clone(), Const::getInt(), getOper(), getSubExp1(), opIntConst, opRegOf, opSuccessor, opWild, Location::regOf(), result, search(), searchReplace(), and Const::setInt().

Referenced by Assign::fixSuccessor(), and ExpTest::testFixSuccessor().

Exp * Exp::fromSSAleft UserProc proc,
Statement d
 

Definition at line 3150 of file exp.cpp.

References RefExp::accept().

Exp * Exp::genConstraints Exp result  )  [virtual]
 

Reimplemented in Const, Unary, Binary, Ternary, RefExp, and TypeVal.

Definition at line 3168 of file exp.cpp.

References opTrue.

Referenced by Binary::constrainSub(), and Assign::genConstraints().

char * Exp::getAnyStrConst  ) 
 

Definition at line 3831 of file exp.cpp.

References getSubExp1(), NULL, op, opMemOf, opStrConst, and opSubscript.

virtual int Exp::getArity  )  [inline, virtual]
 

Reimplemented in Unary, Binary, and Ternary.

Definition at line 131 of file exp.h.

Referenced by BasicBlock::findNumCases(), and BranchStatement::genConstraints().

int Exp::getComplexityDepth UserProc proc  ) 
 

Definition at line 3887 of file exp.cpp.

References accept(), and ComplexityFinder::getDepth().

Exp * Exp::getGuard  ) 
 

Definition at line 1255 of file exp.cpp.

References getSubExp1(), NULL, op, and opGuard.

unsigned Exp::getLexBegin  )  [inline]
 

Definition at line 96 of file exp.h.

References lexBegin.

unsigned Exp::getLexEnd  )  [inline]
 

Definition at line 97 of file exp.h.

References lexEnd.

int Exp::getMemDepth  ) 
 

Definition at line 3893 of file exp.cpp.

References accept(), and MemDepthFinder::getDepth().

Referenced by Assign::getMemDepth().

virtual int Exp::getNumRefs  )  [inline, virtual]
 

Definition at line 316 of file exp.h.

OPER Exp::getOper  )  const [inline]
 

Definition at line 91 of file exp.h.

References op.

Referenced by CHLLCode::AddAssignmentStatement(), CHLLCode::AddLocal(), GotoStatement::adjustFixedDest(), CHLLCode::appendExp(), condToRelational(), Assignment::definesLoc(), Unary::descendType(), UserProc::filterParams(), UserProc::filterReturns(), BasicBlock::findNumCases(), UserProc::fixCallAndPhiRefs(), fixSuccessor(), RefExp::genConstraints(), Assignment::getDefinitions(), GotoStatement::getFixedDest(), UserProc::getSymbolExp(), hasSetFlags(), CallingConvention::StdC::SparcSignature::isAddrOfStackLocal(), Signature::isAddrOfStackLocal(), isAfpTerm(), PentiumFrontEnd::isAssignFromTern(), RTL::isCompare(), isRegN(), PentiumFrontEnd::isSetX(), BranchStatement::limitOutputWithCondition(), Location::Location(), Binary::match(), Unary::match(), match(), TypeVal::operator *=(), RefExp::operator *=(), TypedExp::operator *=(), Terminal::operator *=(), Ternary::operator *=(), Binary::operator *=(), Unary::operator *=(), Const::operator *=(), TypeVal::operator<(), RefExp::operator<(), TypedExp::operator<(), Ternary::operator<(), Binary::operator<(), Unary::operator<(), Terminal::operator<(), Const::operator<(), TypedExp::operator<<(), Location::polySimplify(), RefExp::polySimplify(), TypedExp::polySimplify(), Ternary::polySimplify(), Binary::polySimplify(), Unary::polySimplify(), ExpCastInserter::postVisit(), GotoStatement::print(), Range::Range(), BranchStatement::rangeAnalysis(), UserProc::remUnusedStmtEtc(), Statement::replaceRef(), Assign::simplify(), Range::unionWith(), UsedLocalFinder::visit(), UsedLocsFinder::visit(), and SetConscripts::visit().

virtual Exp* Exp::getSubExp1  )  [inline, virtual]
 

Reimplemented in Unary.

Definition at line 272 of file exp.h.

Referenced by CHLLCode::AddAssignmentStatement(), CHLLCode::AddLocal(), Constraints::alphaSubst(), Assignment::Assignment(), bypassComp(), DataFlow::canRename(), condToRelational(), UserProc::doesParamChainToCall(), CallStatement::ellipsisProcessing(), StatementList::findOnLeft(), findSwParams(), UserProc::fixCallAndPhiRefs(), fixSuccessor(), CallStatement::genConstraints(), getAnyStrConst(), getGuard(), CallingConvention::StdC::ST20Signature::getProven(), CallingConvention::StdC::PentiumSignature::getProven(), CallingConvention::Win32TcSignature::getProven(), CallingConvention::Win32Signature::getProven(), UserProc::getSymbolExp(), UserProc::getSymbolName(), CallingConvention::StdC::SparcSignature::isAddrOfStackLocal(), Signature::isAddrOfStackLocal(), isAfpTerm(), isBareMemof(), CallingConvention::StdC::PPCSignature::isPreserved(), CallingConvention::StdC::PentiumSignature::isPreserved(), CallingConvention::Win32Signature::isPreserved(), UserProc::isRetNonFakeUsed(), Signature::isStackLocal(), BranchStatement::limitOutputWithCondition(), UserProc::lookupSym(), UserProc::mapExpressionsToLocals(), Binary::match(), Unary::match(), TypeVal::operator *=(), RefExp::operator *=(), TypedExp::operator *=(), Terminal::operator *=(), Ternary::operator *=(), Binary::operator *=(), Unary::operator *=(), Const::operator *=(), TypedExp::operator<(), Unary::operator<(), TypedExp::operator<<(), Unary::operator==(), partitionTerms(), Location::polySimplify(), TypedExp::polySimplify(), Ternary::polySimplify(), Binary::polySimplify(), Unary::polySimplify(), PentiumFrontEnd::processStringInst(), Range::Range(), BranchStatement::rangeAnalysis(), Assign::rangeAnalysis(), UserProc::removeRedundantParameters(), ReturnStatement::removeReturn(), DataFlow::renameBlockVars(), UserProc::reverseStrengthReduction(), Proc::setProvenTrue(), Assign::simplify(), Constraints::solve(), stackOffset(), Range::unionWith(), StmtSsaXformer::visit(), UsedLocsVisitor::visit(), and UsedLocsFinder::visit().

virtual Exp* Exp::getSubExp2  )  [inline, virtual]
 

Reimplemented in Binary.

Definition at line 273 of file exp.h.

Referenced by Constraints::alphaSubst(), condToRelational(), Unary::descendType(), findSwParams(), UserProc::fixCallAndPhiRefs(), UserProc::getSymbolExp(), RTL::isCompare(), UserProc::isLocalOrParamPattern(), PentiumFrontEnd::isSetX(), BranchStatement::limitOutputWithCondition(), Binary::match(), Binary::operator *=(), Binary::operator<(), Binary::operator==(), partitionTerms(), UserProc::prover(), Range::Range(), BranchStatement::rangeAnalysis(), Assign::rangeAnalysis(), Proc::setProvenTrue(), Constraints::solve(), stackOffset(), and Range::unionWith().

virtual Exp* Exp::getSubExp3  )  [inline, virtual]
 

Reimplemented in Ternary.

Definition at line 274 of file exp.h.

Referenced by PentiumFrontEnd::isSetX(), Ternary::operator *=(), Ternary::operator<(), and Ternary::operator==().

int Exp::getVarIndex  ) 
 

Definition at line 1243 of file exp.cpp.

References op, and opVar.

bool Exp::isAddrOf  )  [inline]
 

Definition at line 152 of file exp.h.

References op, and opAddrOf.

Referenced by CallStatement::ellipsisProcessing(), UserProc::mapExpressionsToLocals(), Binary::polySimplify(), CallBypasser::postVisit(), Unary::simplifyAddr(), and Constraints::solve().

bool Exp::isAfpTerm  ) 
 

Definition at line 1218 of file exp.cpp.

References getOper(), Unary::getSubExp1(), getSubExp1(), op, opAddrOf, opAFP, opIntConst, opMemOf, opMinus, opPlus, and opTypedExp.

Referenced by ExpTest::testIsAfpTerm().

bool Exp::isAnull  )  [inline]
 

Definition at line 160 of file exp.h.

References op, and opAnull.

bool Exp::isArrayIndex  )  [inline]
 

Definition at line 154 of file exp.h.

References op, and opArrayIndex.

Referenced by ExpSubscripter::preVisit().

bool Exp::isBoolConst  )  [inline]
 

Definition at line 204 of file exp.h.

References op, opFalse, and opTrue.

Referenced by Binary::polySimplify().

bool Exp::isComparison  )  [inline]
 

Definition at line 208 of file exp.h.

References op, opEquals, opGtr, opGtrEq, opGtrEqUns, opGtrUns, opLess, opLessEq, opLessEqUns, opLessUns, and opNotEqual.

bool Exp::isConjunction  )  [inline]
 

Definition at line 202 of file exp.h.

References op, and opAnd.

Referenced by nextConjunct().

bool Exp::isConst  )  [inline]
 

Definition at line 176 of file exp.h.

References op, opIntConst, and opStrConst.

Referenced by Prog::addReloc().

bool Exp::isDisjunction  )  [inline]
 

Definition at line 200 of file exp.h.

References op, and opOr.

Referenced by nextDisjunct().

bool Exp::isEquality  )  [inline]
 

Definition at line 206 of file exp.h.

References op, and opEquals.

Referenced by Constraints::alphaSubst(), ConstraintMap::insert(), UserProc::prove(), and Proc::setProvenTrue().

bool Exp::isFalse  )  [inline]
 

Definition at line 198 of file exp.h.

References op, and opFalse.

bool Exp::isFlagCall  )  [inline]
 

Definition at line 138 of file exp.h.

References op, and opFlagCall.

Referenced by hasSetFlags(), BranchStatement::rangeAnalysis(), Assign::rangeAnalysis(), Statement::replaceRef(), and FlagsFinder::visit().

bool Exp::isFlags  )  [inline]
 

Definition at line 140 of file exp.h.

References op, opFflags, and opFlags.

Referenced by DataFlow::canRename(), Statement::propagateFlagsTo(), BranchStatement::rangeAnalysis(), Assign::rangeAnalysis(), and Statement::replaceRef().

bool Exp::isFltConst  )  [inline]
 

Definition at line 174 of file exp.h.

References op, and opFltConst.

bool Exp::isGlobal  )  [inline]
 

Definition at line 188 of file exp.h.

References op, and opGlobal.

Referenced by Binary::polySimplify(), and ConstGlobalConverter::preVisit().

bool Exp::isIntConst  )  [inline]
 

Definition at line 168 of file exp.h.

References op, and opIntConst.

Referenced by PentiumDecoder::decodeInstruction(), Unary::descendType(), BasicBlock::findNumCases(), UserProc::fixCallAndPhiRefs(), Ternary::genConstraints(), UserProc::getSymbolExp(), hasSetFlags(), CallingConvention::StdC::SparcSignature::isAddrOfStackLocal(), Signature::isAddrOfStackLocal(), UserProc::isLocalOrParamPattern(), PentiumFrontEnd::isSetX(), BranchStatement::limitOutputWithCondition(), ExpCastInserter::postVisit(), BranchStatement::print(), Range::print(), Unary::print(), Range::Range(), CallStatement::rangeAnalysis(), UserProc::reverseStrengthReduction(), Assign::simplify(), and Range::unionWith().

bool Exp::isLocal  )  [inline]
 

Definition at line 186 of file exp.h.

References op, and opLocal.

Referenced by DataFlow::canRename(), UserProc::findLocal(), UserProc::getSymbolName(), UserProc::getTypeForLocation(), UserProc::isLocal(), StmtSsaXformer::visit(), and UsedLocalFinder::visit().

bool Exp::isLocation  )  [inline]
 

Definition at line 221 of file exp.h.

References op, opGlobal, opLocal, opMemOf, opParam, and opRegOf.

Referenced by Unary::descendType().

bool Exp::isMachFtr  )  [inline]
 

Definition at line 216 of file exp.h.

References op, and opMachFtr.

Referenced by PentiumFrontEnd::processStringInst().

bool Exp::isMainFlag  )  [inline]
 

Definition at line 142 of file exp.h.

References op, opOF, and opZF.

Referenced by DataFlow::canRename(), and Statement::propagateFlagsTo().

bool Exp::isMemberOf  )  [inline]
 

Definition at line 156 of file exp.h.

References op, and opMemberAccess.

bool Exp::isMemOf  )  [inline]
 

Definition at line 150 of file exp.h.

References op, and opMemOf.

Referenced by ImplicitAssign::accept(), PhiAssign::accept(), Assign::accept(), BoolAssign::accept(), Statement::calcMayAlias(), DataFlow::canRename(), StmtCastInserter::common(), Assignment::dfaTypeAnalysis(), CallStatement::ellipsisProcessing(), CallStatement::genConstraints(), UserProc::getSymbolExp(), isBareMemof(), UserProc::isLocal(), UserProc::isLocalOrParamPattern(), Signature::isStackLocal(), CallStatement::localiseComp(), UserProc::mapExpressionsToLocals(), ExpCastInserter::postVisit(), CallBypasser::postVisit(), DfaLocalMapper::preVisit(), ConstGlobalConverter::preVisit(), ExpSubscripter::preVisit(), Statement::propagateTo(), Assign::rangeAnalysis(), DataFlow::renameBlockVars(), stackOffset(), Assign::usesExp(), Assignment::usesExp(), BoolAssign::usesExp(), BadMemofFinder::visit(), ExpHasMemofTester::visit(), PrimitiveTester::visit(), MemDepthFinder::visit(), ConstFinder::visit(), StmtSubscripter::visit(), UsedLocsVisitor::visit(), and UsedLocsFinder::visit().

bool Exp::isNil  )  [inline]
 

Definition at line 162 of file exp.h.

References op, and opNil.

bool Exp::isParam  )  [inline]
 

Definition at line 218 of file exp.h.

References op, and opParam.

Referenced by UserProc::getSymbolName().

bool Exp::isPC  )  [inline]
 

Definition at line 164 of file exp.h.

References op, and opPC.

Referenced by CallStatement::getTypeFor().

bool Exp::isPostVar  )  [inline]
 

Definition at line 178 of file exp.h.

References op, and opPostVar.

bool Exp::isRegN int  n  ) 
 

Definition at line 1206 of file exp.cpp.

References getOper(), op, opIntConst, and opRegOf.

Referenced by CHLLCode::AddProcDec(), UserProc::fixCallAndPhiRefs(), UserProc::getSymbolExp(), CallingConvention::StdC::SparcSignature::returnCompare(), CallingConvention::StdC::PentiumSignature::returnCompare(), stackOffset(), and ReturnStatement::updateReturns().

bool Exp::isRegOf  )  [inline]
 

Definition at line 144 of file exp.h.

References op, and opRegOf.

Referenced by CallingConvention::StdC::SparcSignature::argumentCompare(), Assignment::Assignment(), DataFlow::canRename(), UserProc::checkLocalFor(), UserProc::getRegName(), RTL::isCompare(), PentiumFrontEnd::isSetX(), DataFlow::renameBlockVars(), Assign::usesExp(), Assignment::usesExp(), ExpRegMapper::visit(), StmtSubscripter::visit(), and UsedLocsVisitor::visit().

bool Exp::isRegOfK  ) 
 

Definition at line 1195 of file exp.cpp.

References op, opIntConst, and opRegOf.

Referenced by CallingConvention::StdC::SparcLibSignature::getProven(), CallingConvention::StdC::SparcSignature::getProven(), CallingConvention::StdC::ST20Signature::getProven(), CallingConvention::StdC::PPCSignature::getProven(), CallingConvention::StdC::PentiumSignature::getProven(), CallingConvention::Win32TcSignature::getProven(), CallingConvention::Win32Signature::getProven(), CallingConvention::StdC::SparcSignature::isPreserved(), CallingConvention::StdC::PPCSignature::isPreserved(), CallingConvention::StdC::PentiumSignature::isPreserved(), and CallingConvention::Win32Signature::isPreserved().

bool Exp::isSizeCast  )  [inline]
 

Definition at line 180 of file exp.h.

References op, and opSize.

Referenced by RTLInstDict::partialType(), and SizeStripper::preVisit().

bool Exp::isStrConst  )  [inline]
 

Definition at line 170 of file exp.h.

References op, and opStrConst.

Referenced by Binary::match(), and CallStatement::rangeAnalysis().

bool Exp::isSubscript  )  [inline]
 

Definition at line 182 of file exp.h.

References op, and opSubscript.

Referenced by Statement::canPropagateToExp(), DataFlow::canRename(), condToRelational(), CallStatement::convertToDirect(), CallStatement::ellipsisProcessing(), StatementList::findOnLeft(), findSwParams(), UserProc::fixCallAndPhiRefs(), UserProc::getSymbolExp(), CallingConvention::StdC::SparcSignature::isAddrOfStackLocal(), Signature::isAddrOfStackLocal(), Statement::isNullStatement(), Signature::isStackLocal(), UserProc::mapExpressionsToLocals(), UserProc::newLocalName(), Binary::polySimplify(), ExpPropagator::postVisit(), UserProc::removeRedundantParameters(), ReturnStatement::removeReturn(), CallStatement::setTypeFor(), and stackOffset().

bool Exp::isTemp  ) 
 

Definition at line 3117 of file exp.cpp.

References op, opRegOf, and opTemp.

Referenced by DataFlow::canRename(), condToRelational(), RTL::insertAfterTemps(), Unary::print(), and TempToLocalMapper::visit().

virtual bool Exp::isTerminal  )  [inline, virtual]
 

Reimplemented in Terminal.

Definition at line 194 of file exp.h.

Referenced by Assign::rangeAnalysis(), and LocationSet::substitute().

bool Exp::isTrue  )  [inline]
 

Definition at line 196 of file exp.h.

References op, and opTrue.

Referenced by Assign::simplify().

bool Exp::isTypedExp  )  [inline]
 

Definition at line 226 of file exp.h.

References op, and opTypedExp.

Referenced by CHLLCode::appendExp(), and UserProc::lookupSym().

bool Exp::isTypeOf  )  [inline]
 

Definition at line 190 of file exp.h.

References op, and opTypeOf.

Referenced by Constraints::solve().

bool Exp::isTypeVal  )  [inline]
 

Definition at line 214 of file exp.h.

References op, and opTypeVal.

Referenced by Constraints::alphaSubst(), Binary::simplifyConstraint(), Constraints::solve(), and Constraints::unify().

Exp * Exp::killFill  ) 
 

Definition at line 3104 of file exp.cpp.

References doSearch(), result, srch1(), and srch2().

Referenced by ExpTest::testKillFill().

bool Exp::match const char *  pattern,
std::map< std::string, Exp * > &  bindings
[virtual]
 

Reimplemented in Const, Terminal, Unary, Binary, Ternary, RefExp, and Location.

Definition at line 1367 of file exp.cpp.

References ISVARIABLE, and print().

Exp * Exp::match Exp pattern  )  [virtual]
 

Reimplemented in Unary, Binary, and RefExp.

Definition at line 1266 of file exp.cpp.

References clone(), getOper(), opEquals, opList, opNil, and opVar.

Referenced by Location::match(), Terminal::match(), Const::match(), RefExp::match(), Ternary::match(), Binary::match(), and Unary::match().

virtual bool Exp::operator *= Exp o  )  [pure virtual]
 

Implemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, RefExp, and TypeVal.

virtual bool Exp::operator< const Exp o  )  const [pure virtual]
 

Implemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, RefExp, and TypeVal.

virtual bool Exp::operator<< const Exp o  )  const [inline, virtual]
 

Reimplemented in TypedExp.

Definition at line 124 of file exp.h.

virtual bool Exp::operator== const Exp o  )  const [pure virtual]
 

Implemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, RefExp, and TypeVal.

void Exp::partitionTerms std::list< Exp * > &  positives,
std::list< Exp * > &  negatives,
std::vector< int > &  integers,
bool  negate
 

Definition at line 1702 of file exp.cpp.

References getSubExp1(), getSubExp2(), op, opIntConst, opMinus, opPlus, opTypedExp, and partitionTerms().

Referenced by partitionTerms(), Binary::simplifyArith(), and ExpTest::testPartitionTerms().

virtual Exp* Exp::polySimplify bool &  bMod  )  [inline, virtual]
 

Reimplemented in Unary, Binary, Ternary, TypedExp, RefExp, and Location.

Definition at line 302 of file exp.h.

Referenced by RefExp::polySimplify(), Ternary::polySimplify(), Binary::polySimplify(), Unary::polySimplify(), and simplify().

virtual void Exp::print std::ostream &  os,
bool  html = false
[pure virtual]
 

Implemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, RefExp, and TypeVal.

Referenced by CHLLCode::AddLocal(), condToRelational(), dump(), match(), operator<<(), BranchStatement::print(), GotoStatement::print(), RefExp::print(), TypedExp::print(), Ternary::print(), Unary::print(), Binary::print(), ImplicitAssign::printCompact(), PhiAssign::printCompact(), Assign::printCompact(), BoolAssign::printCompact(), printr(), prints(), printt(), ExpTest::testAssociativity(), ExpTest::testFixSuccessor(), RtlTest::testIsCompare(), ExpTest::testKillFill(), ExpTest::testSearchReplace3(), ExpTest::testSearchReplace4(), ExpTest::testSimpConstr(), ExpTest::testSimplifyAddr(), ExpTest::testSimplifyArith(), and ExpTest::testSimplifyBinary().

void Exp::printAsHL std::ostream &  os = std::cout  ) 
 

Definition at line 3030 of file exp.cpp.

virtual void Exp::printr std::ostream &  os,
bool  html = false
[inline, virtual]
 

Reimplemented in Binary, and Ternary.

Definition at line 107 of file exp.h.

References print().

Referenced by Ternary::print(), and Binary::print().

char * Exp::prints  ) 
 

Definition at line 1043 of file exp.cpp.

References debug_buffer, DEBUG_BUFSIZE, and print().

Referenced by Global::print().

void Exp::printt std::ostream &  os = std::cout  ) 
 

Definition at line 2998 of file exp.cpp.

References Type::getSize(), opTypedExp, and print().

Referenced by operator<<().

virtual void Exp::printx int  ind  )  [pure virtual]
 

Implemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, RefExp, and TypeVal.

Referenced by child().

Exp * Exp::propagateAll  ) 
 

Propagate all possible assignments to components of this expression.

Definition at line 3900 of file exp.cpp.

References accept().

Referenced by PhiAssign::convertToAssign().

Exp * Exp::propagateAllRpt bool &  changed  ) 
 

Definition at line 3906 of file exp.cpp.

References accept(), ExpPropagator::clearChanged(), and ExpPropagator::isChanged().

Referenced by Localiser::postVisit().

Exp *& Exp::refSubExp1  )  [virtual]
 

Reimplemented in Unary.

Definition at line 257 of file exp.cpp.

References dummy.

Exp *& Exp::refSubExp2  )  [virtual]
 

Reimplemented in Binary.

Definition at line 258 of file exp.cpp.

References dummy.

Exp *& Exp::refSubExp3  )  [virtual]
 

Reimplemented in Ternary.

Definition at line 259 of file exp.cpp.

References dummy.

Exp * Exp::removeSubscripts bool &  allZero  ) 
 

Definition at line 3126 of file exp.cpp.

References addUsedLocs(), LocationSet::begin(), LocationSet::end(), Statement::getNumber(), NULL, opSubscript, and searchReplaceAll().

Referenced by ArgSourceProvider::exists(), UserProc::mapParameters(), and ArgSourceProvider::nextArgLoc().

bool Exp::search Exp search,
Exp *&  result
[virtual]
 

Definition at line 1642 of file exp.cpp.

References doSearch(), and result.

Referenced by CHLLCode::AddAssignmentStatement(), doSearch(), Ternary::doSearchChildren(), Binary::doSearchChildren(), Unary::doSearchChildren(), fixSuccessor(), PentiumFrontEnd::isStoreFsw(), ImpRefStatement::search(), ImplicitAssign::search(), PhiAssign::search(), Assign::search(), BoolAssign::search(), BranchStatement::search(), GotoStatement::search(), searchAll(), searchReplace(), searchReplaceAll(), ExpTest::testSearch1(), Assign::usesExp(), BoolAssign::usesExp(), GotoStatement::usesExp(), and BranchStatement::usesExp().

bool Exp::searchAll Exp search,
std::list< Exp * > &  result
 

Definition at line 1665 of file exp.cpp.

References doSearch(), and search().

Referenced by ImpRefStatement::searchAll(), ImplicitAssign::searchAll(), PhiAssign::searchAll(), Assign::searchAll(), BoolAssign::searchAll(), CaseStatement::searchAll(), BranchStatement::searchAll(), and GotoStatement::searchAll().

Exp * Exp::searchReplace Exp search,
Exp replace,
bool &  change
 

Definition at line 1597 of file exp.cpp.

References search(), and searchReplaceAll().

Referenced by fixSuccessor(), ExpTest::testSearchReplace1(), and ExpTest::testSearchReplace2().

Exp * Exp::searchReplaceAll Exp search,
Exp replace,
bool &  change,
bool  once = false
 

Definition at line 1615 of file exp.cpp.

References clone(), doSearch(), and search().

Referenced by ExpPropagator::postVisit(), removeSubscripts(), ImpRefStatement::searchAndReplace(), ImplicitAssign::searchAndReplace(), PhiAssign::searchAndReplace(), Assign::searchAndReplace(), BoolAssign::searchAndReplace(), CaseStatement::searchAndReplace(), BranchStatement::searchAndReplace(), GotoStatement::searchAndReplace(), searchReplace(), RangeMap::substInto(), ExpTest::testSearchReplace1(), ExpTest::testSearchReplace3(), and ExpTest::testSearchReplace4().

void Exp::setConscripts int  n,
bool  bClear
 

Definition at line 3674 of file exp.cpp.

References accept().

Referenced by ExpTest::testSetConscripts().

void Exp::setLexBegin unsigned int  n  )  [inline]
 

Definition at line 94 of file exp.h.

References lexBegin.

Referenced by Const::print().

void Exp::setLexEnd unsigned int  n  )  [inline]
 

Definition at line 95 of file exp.h.

References lexEnd.

Referenced by Const::print().

void Exp::setOper OPER  x  )  [inline]
 

Definition at line 92 of file exp.h.

References op.

Referenced by Unary::polySimplify().

virtual void Exp::setSubExp1 Exp e  )  [inline, virtual]
 

Reimplemented in Unary.

Definition at line 278 of file exp.h.

Referenced by Assign::rangeAnalysis(), Assign::simplify(), and StmtSubscripter::visit().

virtual void Exp::setSubExp2 Exp e  )  [inline, virtual]
 

Reimplemented in Binary.

Definition at line 279 of file exp.h.

virtual void Exp::setSubExp3 Exp e  )  [inline, virtual]
 

Reimplemented in Ternary.

Definition at line 280 of file exp.h.

Exp * Exp::simplify  ) 
 

Definition at line 1886 of file exp.cpp.

References clone(), polySimplify(), and save().

Referenced by UserProc::branchAnalysis(), condToRelational(), Binary::genConstraints(), BasicBlock::generateCode(), Localiser::postVisit(), SimpExpModifier::postVisit(), CallBypasser::postVisit(), ImpRefStatement::simplify(), PhiAssign::simplify(), Assign::simplify(), CaseStatement::simplify(), GotoStatement::simplify(), RangeMap::substInto(), ExpTest::testAssociativity(), ExpTest::testSimplifyBinary(), and ExpTest::testSimplifyUnary().

virtual Exp* Exp::simplifyAddr  )  [inline, virtual]
 

Reimplemented in Unary, Binary, and Ternary.

Definition at line 304 of file exp.h.

Referenced by Assignment::simplifyAddr(), Assign::simplifyAddr(), Ternary::simplifyAddr(), Binary::simplifyAddr(), and ExpTest::testSimplifyAddr().

virtual Exp* Exp::simplifyArith  )  [inline, virtual]
 

Reimplemented in Unary, Binary, and Ternary.

Definition at line 298 of file exp.h.

Referenced by condToRelational(), Assign::simplify(), GotoStatement::simplify(), Binary::simplifyArith(), Ternary::simplifyArith(), Unary::simplifyArith(), RangeMap::substInto(), ExpTest::testAssociativity(), and ExpTest::testSimplifyArith().

virtual Exp* Exp::simplifyConstraint  )  [inline, virtual]
 

Reimplemented in Unary, and Binary.

Definition at line 305 of file exp.h.

Referenced by Binary::simplifyConstraint(), Unary::simplifyConstraint(), and ExpTest::testSimpConstr().

Exp * Exp::stripSizes  ) 
 

Definition at line 3681 of file exp.cpp.

References accept().

Referenced by SizeStripper::preVisit().


Friends And Related Function Documentation

friend class XMLProgParser [friend]
 

Reimplemented in Const, Terminal, Unary, Binary, Ternary, TypedExp, FlagDef, RefExp, TypeVal, and Location.

Definition at line 365 of file exp.h.


Member Data Documentation

unsigned Exp::lexBegin [protected]
 

Definition at line 80 of file exp.h.

Referenced by getLexBegin(), and setLexBegin().

unsigned Exp::lexEnd [protected]
 

Definition at line 80 of file exp.h.

Referenced by getLexEnd(), and setLexEnd().

OPER Exp::op [protected]
 

Definition at line 78 of file exp.h.

Referenced by Ternary::appendDotFile(), Binary::appendDotFile(), Unary::appendDotFile(), Terminal::appendDotFile(), Const::appendDotFile(), Ternary::ascendType(), Unary::ascendType(), Terminal::ascendType(), Const::ascendType(), Binary::ascendType(), Location::clone(), Ternary::clone(), Binary::clone(), Unary::clone(), Ternary::descendType(), Unary::descendType(), Const::descendType(), Binary::descendType(), doSearch(), Unary::doSearchChildren(), getAnyStrConst(), getGuard(), getOper(), getVarIndex(), isAddrOf(), isAfpTerm(), isAnull(), isArrayIndex(), isBoolConst(), isComparison(), isConjunction(), isConst(), isDisjunction(), isEquality(), isFalse(), isFlagCall(), isFlags(), isFltConst(), isGlobal(), isIntConst(), isLocal(), isLocation(), isMachFtr(), isMainFlag(), isMemberOf(), isMemOf(), isNil(), isParam(), isPC(), isPostVar(), isRegN(), isRegOf(), isRegOfK(), isSizeCast(), isStrConst(), isSubscript(), isTemp(), isTrue(), isTypedExp(), isTypeOf(), isTypeVal(), Location::match(), Binary::match(), Unary::match(), TypedExp::operator *=(), Ternary::operator *=(), Binary::operator *=(), Unary::operator *=(), TypedExp::operator<(), Ternary::operator<(), Binary::operator<(), Unary::operator<(), Terminal::operator<(), Const::operator<(), TypedExp::operator<<(), TypeVal::operator==(), RefExp::operator==(), TypedExp::operator==(), Terminal::operator==(), Ternary::operator==(), Binary::operator==(), Unary::operator==(), Const::operator==(), partitionTerms(), XMLProgParser::persistToXML(), Ternary::print(), Unary::print(), Terminal::print(), Binary::print(), Const::print(), Const::printNoQuotes(), Ternary::printr(), Binary::printr(), setOper(), Binary::simplifyArith(), and Unary::simplifyArith().


The documentation for this class was generated from the following files:
Generated on Tue Sep 19 21:18:42 2006 for Boomerang by  doxygen 1.4.6