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) More...
 
virtual DatatypegetType (void) const =0
 Get the data-type associate with this. More...
 
virtual Address getAddress (void) const =0
 Get the storage address for this parameter. More...
 
virtual int4 getSize (void) const =0
 Get the number of bytes occupied by this parameter. More...
 
virtual bool isTypeLocked (void) const =0
 Is the parameter data-type locked. More...
 
virtual bool isNameLocked (void) const =0
 Is the parameter name locked. More...
 
virtual bool isSizeTypeLocked (void) const =0
 Is the size of the parameter locked. More...
 
virtual bool isThisPointer (void) const =0
 Is this the "this" pointer for a class method. More...
 
virtual bool isIndirectStorage (void) const =0
 Is this really a pointer to the true parameter. More...
 
virtual bool isHiddenReturn (void) const =0
 Is this a pointer to storage for a return value. More...
 
virtual bool isNameUndefined (void) const =0
 Is the name of this parameter undefined. More...
 
virtual void setTypeLock (bool val)=0
 Toggle the lock on the data-type. More...
 
virtual void setNameLock (bool val)=0
 Toggle the lock on the name. More...
 
virtual void setThisPointer (bool val)=0
 Toggle whether this is the "this" pointer for a class method. More...
 
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. More...
 
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

◆ clone()

virtual ProtoParameter * ProtoParameter::clone ( void  ) const
pure virtual

Clone the parameter.

Implemented in ParameterBasic, and ParameterSymbol.

Referenced by ProtoStoreSymbol::clone(), and ProtoStoreInternal::clone().

◆ getAddress()

virtual Address ProtoParameter::getAddress ( void  ) const
pure virtual

◆ getName()

virtual const string & ProtoParameter::getName ( void  ) const
pure virtual

Get the name of the parameter ("" for return value)

Implemented in ParameterBasic, and ParameterSymbol.

Referenced by FuncProto::getPieces(), ActionNameVars::makeRec(), FuncProto::paramShift(), and ProtoStoreInternal::saveXml().

◆ getSize()

virtual int4 ProtoParameter::getSize ( void  ) const
pure virtual

◆ getSymbol()

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 ParameterBasic, and ParameterSymbol.

Referenced by PrintC::emitPrototypeInputs().

◆ getType()

virtual Datatype * ProtoParameter::getType ( void  ) const
pure virtual

◆ isHiddenReturn()

virtual bool ProtoParameter::isHiddenReturn ( void  ) const
pure virtual

Is this a pointer to storage for a return value.

Implemented in ParameterBasic, and ParameterSymbol.

Referenced by ProtoStoreInternal::saveXml(), and FuncProto::updateThisPointer().

◆ isIndirectStorage()

virtual bool ProtoParameter::isIndirectStorage ( void  ) const
pure virtual

Is this really a pointer to the true parameter.

Implemented in ParameterBasic, and ParameterSymbol.

Referenced by ProtoStoreInternal::restoreXml(), and ProtoStoreInternal::saveXml().

◆ isNameLocked()

virtual bool ProtoParameter::isNameLocked ( void  ) const
pure virtual

Is the parameter name locked.

Implemented in ParameterBasic, and ParameterSymbol.

Referenced by ActionNameVars::makeRec(), and ProtoStoreInternal::saveXml().

◆ isNameUndefined()

virtual bool ProtoParameter::isNameUndefined ( void  ) const
pure virtual

Is the name of this parameter undefined.

Implemented in ParameterBasic, and ParameterSymbol.

Referenced by ActionNameVars::makeRec().

◆ isSizeTypeLocked()

virtual bool ProtoParameter::isSizeTypeLocked ( void  ) const
pure virtual

Is the size of the parameter locked.

Implemented in ParameterBasic, and ParameterSymbol.

Referenced by ActionOutputPrototype::apply(), FuncProto::clearUnlockedOutput(), and FuncProto::updateOutputTypes().

◆ isThisPointer()

virtual bool ProtoParameter::isThisPointer ( void  ) const
pure virtual

◆ isTypeLocked()

virtual bool ProtoParameter::isTypeLocked ( void  ) const
pure virtual

◆ operator!=()

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

◆ operator==()

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().

◆ overrideSizeLockType()

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 ParameterBasic, and ParameterSymbol.

Referenced by FuncProto::updateOutputTypes().

◆ resetSizeLockType()

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 ParameterBasic, and ParameterSymbol.

Referenced by FuncProto::clearUnlockedOutput().

◆ setNameLock()

virtual void ProtoParameter::setNameLock ( bool  val)
pure virtual

Toggle the lock on the name.

Implemented in ParameterBasic, and ParameterSymbol.

Referenced by ProtoStoreInternal::restoreXml().

◆ setThisPointer()

virtual void ProtoParameter::setThisPointer ( bool  val)
pure virtual

Toggle whether this is the "this" pointer for a class method.

Implemented in ParameterBasic, and ParameterSymbol.

Referenced by FuncProto::updateThisPointer().

◆ setTypeLock()

virtual void ProtoParameter::setTypeLock ( bool  val)
pure virtual

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