SparcFrontEnd Class Reference

#include <frontend/sparcfrontend.h>

Inheritance diagram for SparcFrontEnd:

FrontEnd List of all members.

Detailed Description

Definition at line 18 of file sparcfrontend.h.

Public Member Functions

virtual std::vector< Exp * > & getDefaultParams ()
virtual std::vector< Exp * > & getDefaultReturns ()
virtual platform getFrontEndId ()
virtual ADDRESS getMainEntryPoint (bool &gotMain)
virtual bool processProc (ADDRESS uAddr, UserProc *pProc, std::ofstream &os, bool frag=false, bool spec=false)
 SparcFrontEnd (BinaryFile *pBF, Prog *prog, BinaryFileFactory *pbff)
virtual ~SparcFrontEnd ()
 Virtual destructor.

Private Member Functions

void appendAssignment (Exp *lhs, Exp *rhs, Type *type, ADDRESS addr, std::list< RTL * > *lrtl)
bool case_CALL (ADDRESS &address, DecodeResult &inst, DecodeResult &delay_inst, std::list< RTL * > *&BB_rtls, UserProc *proc, std::list< CallStatement * > &callList, std::ofstream &os, bool isPattern=false)
bool case_DD (ADDRESS &address, int delta, DecodeResult &inst, DecodeResult &delay_inst, std::list< RTL * > *&BB_rtls, TargetQueue &tq, UserProc *proc, std::list< CallStatement * > &callList)
bool case_SCD (ADDRESS &address, int delta, ADDRESS hiAddress, DecodeResult &inst, DecodeResult &delay_inst, std::list< RTL * > *&BB_rtls, Cfg *cfg, TargetQueue &tq)
bool case_SCDAN (ADDRESS &address, int delta, ADDRESS hiAddress, DecodeResult &inst, DecodeResult &delay_inst, std::list< RTL * > *&BB_rtls, Cfg *cfg, TargetQueue &tq)
void case_SD (ADDRESS &address, int delta, ADDRESS hiAddress, DecodeResult &inst, DecodeResult &delay_inst, std::list< RTL * > *&BB_rtls, Cfg *cfg, TargetQueue &tq, std::ofstream &os)
void case_unhandled_stub (ADDRESS addr)
void emitCopyPC (std::list< RTL * > *pRtls, ADDRESS uAddr)
void emitNop (std::list< RTL * > *pRtls, ADDRESS uAddr)
unsigned fetch4 (unsigned char *ptr)
void gen32op32gives64 (OPER op, std::list< RTL * > *lrtl, ADDRESS addr)
void handleBranch (ADDRESS dest, ADDRESS hiAddress, BasicBlock *&newBB, Cfg *cfg, TargetQueue &tq)
void handleCall (UserProc *proc, ADDRESS dest, BasicBlock *callBB, Cfg *cfg, ADDRESS address, int offset=0)
bool helperFunc (ADDRESS dest, ADDRESS addr, std::list< RTL * > *lrtl)
bool helperFuncLong (ADDRESS dest, ADDRESS addr, std::list< RTL * > *lrtl, std::string &name)
BasicBlock * optimise_CallReturn (CallStatement *call, RTL *rtl, RTL *delay, UserProc *pProc)
bool optimise_DelayCopy (ADDRESS src, ADDRESS dest, int delta, ADDRESS uUpper)
void quadOperation (ADDRESS addr, std::list< RTL * > *lrtl, OPER op)
void warnDCTcouple (ADDRESS uAt, ADDRESS uDest)

Private Attributes

DecodeResult nop_inst


Constructor & Destructor Documentation

SparcFrontEnd::SparcFrontEnd (  BinaryFile *  pBF,
Prog *  prog,
BinaryFileFactory *  pbff
) 
 

Definition at line 1495 of file sparcfrontend.cpp.

References NOP, nop_inst, DecodeResult::numBytes, FrontEnd::prog, DecodeResult::rtl, DecodeResult::type, and DecodeResult::valid.

SparcFrontEnd::~SparcFrontEnd (   )  [virtual]
 

Virtual destructor.

Definition at line 1504 of file sparcfrontend.cpp.


Member Function Documentation

void SparcFrontEnd::appendAssignment (  Exp *  lhs,
Exp *  rhs,
Type *  type,
ADDRESS  addr,
std::list< RTL * > *  lrtl
)  [private]
 

Definition at line 1253 of file sparcfrontend.cpp.

Referenced by helperFuncLong(), and quadOperation().

bool SparcFrontEnd::case_CALL (  ADDRESS &  address,
DecodeResult &  inst,
DecodeResult &  delay_inst,
std::list< RTL * > *&  BB_rtls,
UserProc *  proc,
std::list< CallStatement * > &  callList,
std::ofstream &  os,
bool  isPattern = false
)  [private]
 

Definition at line 225 of file sparcfrontend.cpp.

References Boomerang::get(), RTL::getList(), CallStatement::isReturnAfterCall(), NOP, RTL::print(), DecodeResult::rtl, DecodeResult::type, and RTL::updateAddress().

bool SparcFrontEnd::case_DD (  ADDRESS &  address,
int  delta,
DecodeResult &  inst,
DecodeResult &  delay_inst,
std::list< RTL * > *&  BB_rtls,
TargetQueue &  tq,
UserProc *  proc,
std::list< CallStatement * > &  callList
)  [private]
 

Definition at line 412 of file sparcfrontend.cpp.

References COMPCALL, COMPJUMP, FrontEnd::createReturnBlock(), UserProc::getCFG(), BasicBlock::getDest(), Statement::getKind(), RTL::getList(), Cfg::newBB(), NOP, NULL, BasicBlock::processSwitch(), DecodeResult::rtl, STMT_CALL, STMT_CASE, STMT_RET, DecodeResult::type, and RTL::updateAddress().

bool SparcFrontEnd::case_SCD (  ADDRESS &  address,
int  delta,
ADDRESS  hiAddress,
DecodeResult &  inst,
DecodeResult &  delay_inst,
std::list< RTL * > *&  BB_rtls,
Cfg *  cfg,
TargetQueue &  tq
)  [private]
 

Definition at line 515 of file sparcfrontend.cpp.

References Cfg::addOutEdge(), RTL::areFlagsAffected(), GotoStatement::getFixedDest(), RTL::getList(), handleBranch(), RTL::isCall(), Cfg::newBB(), NOP, NULL, DecodeResult::rtl, TWOWAY, DecodeResult::type, and RTL::updateAddress().

bool SparcFrontEnd::case_SCDAN (  ADDRESS &  address,
int  delta,
ADDRESS  hiAddress,
DecodeResult &  inst,
DecodeResult &  delay_inst,
std::list< RTL * > *&  BB_rtls,
Cfg *  cfg,
TargetQueue &  tq
)  [private]
 

Definition at line 628 of file sparcfrontend.cpp.

References Cfg::addOutEdge(), GotoStatement::adjustFixedDest(), GotoStatement::getFixedDest(), RTL::getList(), handleBranch(), Cfg::newBB(), NULL, ONEWAY, optimise_DelayCopy(), DecodeResult::rtl, BasicBlock::setJumpReqd(), TWOWAY, RTL::updateAddress(), and TargetQueue::visit().

void SparcFrontEnd::case_SD (  ADDRESS &  address,
int  delta,
ADDRESS  hiAddress,
DecodeResult &  inst,
DecodeResult &  delay_inst,
std::list< RTL * > *&  BB_rtls,
Cfg *  cfg,
TargetQueue &  tq,
std::ofstream &  os
)  [private]
 

Definition at line 357 of file sparcfrontend.cpp.

References GotoStatement::adjustFixedDest(), GotoStatement::getFixedDest(), RTL::getList(), handleBranch(), Cfg::newBB(), NOP, NULL, ONEWAY, optimise_DelayCopy(), DecodeResult::rtl, and DecodeResult::type.

void SparcFrontEnd::case_unhandled_stub (  ADDRESS  addr  )  [private]
 

Definition at line 206 of file sparcfrontend.cpp.

void SparcFrontEnd::emitCopyPC (  std::list< RTL * > *  pRtls,
ADDRESS  uAddr
)  [private]
 

Definition at line 1229 of file sparcfrontend.cpp.

References RTL::appendStmt(), opPC, and Location::regOf().

void SparcFrontEnd::emitNop (  std::list< RTL * > *  pRtls,
ADDRESS  uAddr
)  [private]
 

Definition at line 1209 of file sparcfrontend.cpp.

References RTL::updateAddress().

unsigned SparcFrontEnd::fetch4 (  unsigned char *  ptr  )  [private]
 

void SparcFrontEnd::gen32op32gives64 (  OPER  op,
std::list< RTL * > *  lrtl,
ADDRESS  addr
)  [private]
 

Definition at line 1361 of file sparcfrontend.cpp.

References opAt, opMachFtr, opSgnEx, opTruncs, Location::regOf(), and Location::tempOf().

Referenced by helperFuncLong().

std::vector< Exp * > & SparcFrontEnd::getDefaultParams (   )  [virtual]
 

Implements FrontEnd.

Definition at line 682 of file sparcfrontend.cpp.

References Location::regOf().

std::vector< Exp * > & SparcFrontEnd::getDefaultReturns (   )  [virtual]
 

Implements FrontEnd.

Definition at line 699 of file sparcfrontend.cpp.

References Location::regOf().

virtual platform SparcFrontEnd::getFrontEndId (   )  [inline, virtual]
 

Implements FrontEnd.

Definition at line 31 of file sparcfrontend.h.

References PLAT_SPARC.

ADDRESS SparcFrontEnd::getMainEntryPoint (  bool &  gotMain  )  [virtual]
 

Implements FrontEnd.

Definition at line 1514 of file sparcfrontend.cpp.

References BinaryFile::GetEntryPoint(), BinaryFile::GetMainEntryPoint(), NO_ADDRESS, FrontEnd::pBF, and start().

void SparcFrontEnd::handleBranch (  ADDRESS  dest,
ADDRESS  hiAddress,
BasicBlock *&  newBB,
Cfg *  cfg,
TargetQueue &  tq
)  [private]
 

Definition at line 153 of file sparcfrontend.cpp.

References NULL, and TargetQueue::visit().

Referenced by case_SCD(), case_SCDAN(), and case_SD().

void SparcFrontEnd::handleCall (  UserProc *  proc,
ADDRESS  dest,
BasicBlock *  callBB,
Cfg *  cfg,
ADDRESS  address,
int  offset = 0
)  [private]
 

Definition at line 178 of file sparcfrontend.cpp.

References Prog::findProc(), Boomerang::get(), Proc::getProg(), and NULL.

bool SparcFrontEnd::helperFunc (  ADDRESS  dest,
ADDRESS  addr,
std::list< RTL * > *  lrtl
)  [private, virtual]
 

Reimplemented from FrontEnd.

Definition at line 1277 of file sparcfrontend.cpp.

References helperFuncLong(), BinaryFile::IsDynamicLinkedProc(), NULL, opDiv, opDivs, opFDiv, opFMinus, opFMult, opFPlus, opMod, opMods, opMult, opMults, FrontEnd::pBF, quadOperation(), Location::regOf(), and BinaryFile::SymbolByAddress().

bool SparcFrontEnd::helperFuncLong (  ADDRESS  dest,
ADDRESS  addr,
std::list< RTL * > *  lrtl,
std::string &  name
)  [private]
 

Definition at line 1416 of file sparcfrontend.cpp.

References appendAssignment(), gen32op32gives64(), opDiv, opDivs, opFDiv, opFMinus, opFMult, opFPlus, opMod, opMods, opMult, opMults, quadOperation(), and Location::regOf().

Referenced by helperFunc().

BasicBlock * SparcFrontEnd::optimise_CallReturn (  CallStatement *  call,
RTL *  rtl,
RTL *  delay,
UserProc *  pProc
)  [private]
 

Definition at line 114 of file sparcfrontend.cpp.

References FrontEnd::createReturnBlock(), RTL::elementAt(), RTL::getAddress(), RTL::getNumStmt(), Statement::isAssign(), and CallStatement::isReturnAfterCall().

bool SparcFrontEnd::optimise_DelayCopy (  ADDRESS  src,
ADDRESS  dest,
int  delta,
ADDRESS  uUpper
)  [private]
 

Definition at line 80 of file sparcfrontend.cpp.

Referenced by case_SCDAN(), and case_SD().

bool SparcFrontEnd::processProc (  ADDRESS  uAddr,
UserProc *  pProc,
std::ofstream &  os,
bool  frag = false,
bool  spec = false
)  [virtual]
 

Reimplemented from FrontEnd.

Definition at line 727 of file sparcfrontend.cpp.

References DD, FrontEnd::decodeInstruction(), Boomerang::get(), UserProc::getCFG(), Statement::getKind(), RTL::getList(), BinaryFile::getTextDelta(), TargetQueue::initial(), LOG, TargetQueue::nextAddress(), NO_ADDRESS, NULL, FrontEnd::pBF, FrontEnd::previouslyDecoded, STMT_CALL, STMT_RET, FrontEnd::targetQueue, and Boomerang::traceDecoder.

void SparcFrontEnd::quadOperation (  ADDRESS  addr,
std::list< RTL * > *  lrtl,
OPER  op
)  [private]
 

Definition at line 1265 of file sparcfrontend.cpp.

References appendAssignment(), Location::memOf(), opPlus, and Location::regOf().

Referenced by helperFunc(), and helperFuncLong().

void SparcFrontEnd::warnDCTcouple (  ADDRESS  uAt,
ADDRESS  uDest
)  [private]
 

Definition at line 61 of file sparcfrontend.cpp.


Member Data Documentation

DecodeResult SparcFrontEnd::nop_inst [private]
 

Definition at line 90 of file sparcfrontend.h.

Referenced by SparcFrontEnd().


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