decompiler  1.0.0
Public Member Functions | List of all members
ProtoParameter Class Referenceabstract

A function parameter viewed as a name, data-type, and storage address. More...

#include <fspec.hh>

Inheritance diagram for ProtoParameter:
ParameterBasic ParameterSymbol

Public Member Functions

 ProtoParameter (void)
 Constructor.
 
virtual ~ProtoParameter (void)
 Destructor.
 
virtual const string & getName (void) const =0
 Get the name of the parameter ("" for return value)
 
virtual DatatypegetType (void) const =0
 Get the data-type associate with this.
 
virtual Address getAddress (void) const =0
 Get the storage address for this parameter.
 
virtual int4 getSize (void) const =0
 Get the number of bytes occupied by this parameter.
 
virtual bool isTypeLocked (void) const =0
 Is the parameter data-type locked.
 
virtual bool isNameLocked (void) const =0
 Is the parameter name locked.
 
virtual bool isSizeTypeLocked (void) const =0
 Is the size of the parameter locked.
 
virtual bool isThisPointer (void) const =0
 Is this the "this" pointer for a class method.
 
virtual bool isIndirectStorage (void) const =0
 Is this really a pointer to the true parameter.
 
virtual bool isHiddenReturn (void) const =0
 Is this a pointer to storage for a return value.
 
virtual bool isNameUndefined (void) const =0
 Is the name of this parameter undefined.
 
virtual void setTypeLock (bool val)=0
 Toggle the lock on the data-type.
 
virtual void setNameLock (bool val)=0
 Toggle the lock on the name.
 
virtual void setThisPointer (bool val)=0
 Toggle whether this is the "this" pointer for a class method.
 
virtual void overrideSizeLockType (Datatype *ct)=0
 Change (override) the data-type of a size-locked parameter. More...
 
virtual void resetSizeLockType (TypeFactory *factory)=0
 Clear this parameter's data-type preserving any size-lock. More...
 
virtual ProtoParameterclone (void) const =0
 Clone the parameter.
 
virtual SymbolgetSymbol (void) const =0
 Retrieve the formal Symbol associated with this parameter. More...
 
bool operator== (const ProtoParameter &op2) const
 Compare storage location and data-type for equality. More...
 
bool operator!= (const ProtoParameter &op2) const
 Compare storage location and data-type for inequality. More...
 

Detailed Description

A function parameter viewed as a name, data-type, and storage address.

This is the base class, with derived classes determining what is backing up the information, whether is it a formal Symbol or just internal storage. Both input parameters and return values can be represented with this object.

Member Function Documentation

virtual Symbol* ProtoParameter::getSymbol ( void  ) const
pure virtual

Retrieve the formal Symbol associated with this parameter.

If there is no backing symbol an exception is thrown

Returns
the backing Symbol object

Implemented in ParameterSymbol, and ParameterBasic.

Referenced by PrintC::emitPrototypeInputs().

bool ProtoParameter::operator!= ( const ProtoParameter op2) const
inline

Compare storage location and data-type for inequality.

Parameters
op2is the parameter to compare with this
Returns
true if the parameters do not share a data-type and storage location
bool ProtoParameter::operator== ( const ProtoParameter op2) const
inline

Compare storage location and data-type for equality.

Parameters
op2is the parameter to compare with this
Returns
true if the parameters share a data-type and storage location

References getAddress(), and getType().

virtual void ProtoParameter::overrideSizeLockType ( Datatype ct)
pure virtual

Change (override) the data-type of a size-locked parameter.

The original parameter must have a type-lock and TYPE_UNKNOWN data-type. The size-lock is preserved and this can be cleared back to its TYPE_UNKNOWN state.

Parameters
ctis the overriding data-type

Implemented in ParameterSymbol, and ParameterBasic.

Referenced by FuncProto::updateOutputTypes().

virtual void ProtoParameter::resetSizeLockType ( TypeFactory factory)
pure virtual

Clear this parameter's data-type preserving any size-lock.

The data-type is converted to a TYPE_UNKNOWN of the same size

Parameters
factoryis the TypeFactory that will construct the unknown data-type

Implemented in ParameterSymbol, and ParameterBasic.

Referenced by FuncProto::clearUnlockedOutput().


The documentation for this class was generated from the following file: