OpenASIP  2.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Attributes | List of all members
NullOperation Class Reference

#include <Operation.hh>

Inheritance diagram for NullOperation:
Inheritance graph
Collaboration diagram for NullOperation:
Collaboration graph

Public Member Functions

virtual ~NullOperation ()
 
virtual TCEString name () const
 
virtual TCEString description () const
 
virtual int numberOfInputs () const
 
virtual int numberOfOutputs () const
 
virtual bool usesMemory () const
 
virtual bool readsMemory () const
 
virtual bool writesMemory () const
 
virtual bool canTrap () const
 
virtual bool hasSideEffects () const
 
virtual bool isClocked () const
 
virtual bool isControlFlowOperation () const
 
virtual bool isCall () const
 
virtual bool isBranch () const
 
virtual bool dependsOn (const Operation &op) const
 
virtual int affectsCount () const
 
virtual int affectedByCount () const
 
virtual TCEString affects (unsigned int i) const
 
virtual TCEString affectedBy (unsigned int i) const
 
virtual bool canSwap (int id1, int id2) const
 
virtual Operandinput (int id) const
 
virtual Operandoutput (int id) const
 
virtual Operandoperand (int id) const
 
virtual void setBehavior (OperationBehavior &behavior)
 
virtual OperationBehaviorbehavior () const
 
virtual bool simulateTrigger (SimValue **, OperationContext &context) const
 
virtual void createState (OperationContext &context) const
 
virtual void deleteState (OperationContext &context) const
 
- Public Member Functions inherited from Operation
 Operation (const TCEString &name, OperationBehavior &behavior)
 
virtual ~Operation ()
 
virtual void addDag (const TCEString &code)
 
virtual void removeDag (int index)
 
virtual int dagCount () const
 
virtual OperationDAGdag (int index) const
 
virtual TCEString dagCode (int index) const
 
virtual void setDagCode (int index, const TCEString &code)
 
virtual TCEString dagError (int index) const
 
virtual int operandCount () const
 
virtual bool isVectorOperation () const
 
virtual void setReadsMemory (bool setting)
 
virtual void setWritesMemory (bool setting)
 
virtual bool isBaseOffsetMemOperation () const
 
virtual void setCall (bool setting)
 
virtual void setBranch (bool setting)
 
virtual void setControlFlowOperation (bool setting)
 
virtual bool isPure () const
 
virtual void addInput (Operand *operand)
 
virtual void addOutput (Operand *operand)
 
virtual void loadState (const ObjectState *state)
 
virtual ObjectStatesaveState () const
 
virtual bool areValid (const InputOperandVector &inputs, const OperationContext &context) const
 
virtual bool canBeSimulated () const
 
bool isNull () const
 
TCEString emulationFunctionName () const
 
OperationPimplimpl ()
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Member Functions

static NullOperationinstance ()
 

Protected Member Functions

 NullOperation ()
 Some gcc versions warn about private constructors. More...
 

Private Member Functions

 NullOperation (const NullOperation &)
 Copying not allowed. More...
 
NullOperationoperator= (const NullOperation &)
 Assignment not allowed. More...
 

Static Private Attributes

static NullOperation instance_
 Unique instance of NullOperation. More...
 

Additional Inherited Members

- Public Types inherited from Operation
typedef OperationBehavior::InputOperandVector InputOperandVector
 
- Static Public Attributes inherited from Operation
static const char * OPRN_OPERATION = "operation"
 Object state name for operation. More...
 
static const char * OPRN_NAME = "name"
 Object state name for name. More...
 
static const char * OPRN_DESCRIPTION = "description"
 Object state name for description. More...
 
static const char * OPRN_INPUTS = "inputs"
 Object state name for inputs. More...
 
static const char * OPRN_OUTPUTS = "outputs"
 Object state name for outputs. More...
 
static const char * OPRN_TRAP = "trap"
 Object state name for trap. More...
 
static const char * OPRN_SIDE_EFFECTS = "side-effects"
 Object state name for side effects. More...
 
static const char * OPRN_CLOCKED = "clocked"
 Object state name for clockedness. More...
 
static const char * OPRN_CONTROL_FLOW = "control-flow"
 Object state name for control flow property. More...
 
static const char * OPRN_READS_MEMORY = "reads-memory"
 Object state name for reads memory. More...
 
static const char * OPRN_WRITES_MEMORY = "writes-memory"
 Object state name for writes memory. More...
 
static const char * OPRN_AFFECTS = "affects"
 Object state name for affects. More...
 
static const char * OPRN_AFFECTED_BY = "affected-by"
 Object state name for affected by. More...
 
static const char * OPRN_IN = "in"
 Object state name for input operand. More...
 
static const char * OPRN_OUT = "out"
 Object state name for output operand. More...
 
static const char * OPRN_TRIGGER = "trigger-semantics"
 Object state name for trigger semantics. More...
 
static const char * OPRN_ISCALL = "is-call"
 Object state name for call property. More...
 
static const char * OPRN_ISBRANCH = "is-branch"
 Object state name for branch property. More...
 

Detailed Description

Singleton class that is used to represent a null operation behavior.

All methods cause program abort with an error log message.

Definition at line 186 of file Operation.hh.

Constructor & Destructor Documentation

◆ ~NullOperation()

NullOperation::~NullOperation ( )
virtual

Destructor.

Definition at line 659 of file Operation.cc.

659  {
660 }

◆ NullOperation() [1/2]

NullOperation::NullOperation ( )
protected

Some gcc versions warn about private constructors.

Constructor.

Definition at line 652 of file Operation.cc.

652  :
654 }

◆ NullOperation() [2/2]

NullOperation::NullOperation ( const NullOperation )
private

Copying not allowed.

Member Function Documentation

◆ affectedBy()

TCEString NullOperation::affectedBy ( unsigned int  i) const
virtual

Aborts program with error log message.

Exceptions
Nothing.
Returns
Empty string.

Reimplemented from Operation.

Definition at line 715 of file Operation.cc.

715  {
716 
717  abortWithError("affectedBy()");
718  return "";
719 }

References abortWithError.

◆ affectedByCount()

int NullOperation::affectedByCount ( ) const
virtual

Aborts program with error log message.

Returns
0.

Reimplemented from Operation.

Definition at line 690 of file Operation.cc.

690  {
691  abortWithError("affectedByCount()");
692  return 0;
693 }

References abortWithError.

◆ affects()

TCEString NullOperation::affects ( unsigned int  i) const
virtual

Aborts program with error log message.

Exceptions
Nothing.
Returns
Empty string.

Reimplemented from Operation.

Definition at line 702 of file Operation.cc.

702  {
703 
704  abortWithError("affects()");
705  return "";
706 }

References abortWithError.

◆ affectsCount()

int NullOperation::affectsCount ( ) const
virtual

Aborts program with error log message.

Returns
0.

Reimplemented from Operation.

Definition at line 679 of file Operation.cc.

679  {
680  abortWithError("affectsCount()");
681  return 0;
682 }

References abortWithError.

◆ behavior()

OperationBehavior & NullOperation::behavior ( ) const
virtual

Aborts program with error log message.

Returns
NullOperationBehavior.

Reimplemented from Operation.

Definition at line 771 of file Operation.cc.

771  {
772  abortWithError("behavior()");
774 }

References abortWithError, and NullOperationBehavior::instance().

Here is the call graph for this function:

◆ canSwap()

bool NullOperation::canSwap ( int  id1,
int  id2 
) const
virtual

Aborts program with error log message.

Returns
False

Reimplemented from Operation.

Definition at line 727 of file Operation.cc.

727  {
728  abortWithError("canSwap()");
729  return false;
730 }

References abortWithError.

◆ canTrap()

bool NullOperation::canTrap ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operation.

Definition at line 867 of file Operation.cc.

867  {
868  abortWithError("canTrap()");
869  return false;
870 }

References abortWithError.

◆ createState()

void NullOperation::createState ( OperationContext context) const
virtual

Aborts program with error log message.

Reimplemented from Operation.

Definition at line 944 of file Operation.cc.

944  {
945  abortWithError("createState()");
946 }

References abortWithError.

◆ deleteState()

void NullOperation::deleteState ( OperationContext context) const
virtual

Aborts program with error log message.

Reimplemented from Operation.

Definition at line 952 of file Operation.cc.

952  {
953  abortWithError("deleteState()");
954 }

References abortWithError.

◆ dependsOn()

bool NullOperation::dependsOn ( const Operation op) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operation.

Definition at line 668 of file Operation.cc.

668  {
669  abortWithError("dependsOn()");
670  return false;
671 }

References abortWithError.

◆ description()

TCEString NullOperation::description ( ) const
virtual

Aborts program with error log message.

Returns
An empty string.

Reimplemented from Operation.

Definition at line 801 of file Operation.cc.

801  {
802  abortWithError("description()");
803  return "";
804 }

References abortWithError.

◆ hasSideEffects()

bool NullOperation::hasSideEffects ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operation.

Definition at line 878 of file Operation.cc.

878  {
879  abortWithError("hasSideEffects()");
880  return false;
881 }

References abortWithError.

◆ input()

Operand & NullOperation::input ( int  id) const
virtual

Aborts program with error log message.

Returns
NullOperand.

Reimplemented from Operation.

Definition at line 738 of file Operation.cc.

738  {
739  abortWithError("input()");
740  return NullOperand::instance();
741 }

References abortWithError, and NullOperand::instance().

Here is the call graph for this function:

◆ instance()

static NullOperation& NullOperation::instance ( )
static

◆ isBranch()

bool NullOperation::isBranch ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operation.

Definition at line 920 of file Operation.cc.

920  {
922  return false;
923 }

References __func__, and abortWithError.

◆ isCall()

bool NullOperation::isCall ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operation.

Definition at line 910 of file Operation.cc.

910  {
912  return false;
913 }

References __func__, and abortWithError.

◆ isClocked()

bool NullOperation::isClocked ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operation.

Definition at line 889 of file Operation.cc.

889  {
890  abortWithError("isClocked()");
891  return false;
892 }

References abortWithError.

◆ isControlFlowOperation()

bool NullOperation::isControlFlowOperation ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operation.

Definition at line 900 of file Operation.cc.

900  {
902  return false;
903 }

References __func__, and abortWithError.

◆ name()

TCEString NullOperation::name ( ) const
virtual

Aborts program with error log message.

Returns
An empty string.

Reimplemented from Operation.

Definition at line 790 of file Operation.cc.

790  {
791  abortWithError("name()");
792  return "";
793 }

References abortWithError.

Referenced by ProgramOperation::addNode(), and ProgramOperation::hwopFromOutMove().

◆ numberOfInputs()

int NullOperation::numberOfInputs ( ) const
virtual

Aborts program with error log message.

Returns
-1.

Reimplemented from Operation.

Definition at line 812 of file Operation.cc.

812  {
813  abortWithError("numberOfInputs()");
814  return -1;
815 }

References abortWithError.

Referenced by ProgramOperation::outputNode().

◆ numberOfOutputs()

int NullOperation::numberOfOutputs ( ) const
virtual

Aborts program with error log message.

Returns
-1.

Reimplemented from Operation.

Definition at line 823 of file Operation.cc.

823  {
824  abortWithError("numberOfOutputs()");
825  return -1;
826 }

References abortWithError.

◆ operand()

Operand & NullOperation::operand ( int  id) const
virtual

Aborts program with error log message.

Returns
NullOperand.

Reimplemented from Operation.

Definition at line 760 of file Operation.cc.

760  {
761  abortWithError("operand()");
762  return NullOperand::instance();
763 }

References abortWithError, and NullOperand::instance().

Here is the call graph for this function:

◆ operator=()

NullOperation& NullOperation::operator= ( const NullOperation )
private

Assignment not allowed.

◆ output()

Operand & NullOperation::output ( int  id) const
virtual

Aborts program with error log message.

Returns
NullOperand.

Reimplemented from Operation.

Definition at line 749 of file Operation.cc.

749  {
750  abortWithError("output()");
751  return NullOperand::instance();
752 }

References abortWithError, and NullOperand::instance().

Referenced by ProgramOperation::toString().

Here is the call graph for this function:

◆ readsMemory()

bool NullOperation::readsMemory ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operation.

Definition at line 845 of file Operation.cc.

845  {
846  abortWithError("readsMemory()");
847  return false;
848 }

References abortWithError.

◆ setBehavior()

void NullOperation::setBehavior ( OperationBehavior behavior)
virtual

Aborts program with error log message.

Reimplemented from Operation.

Definition at line 780 of file Operation.cc.

780  {
781  abortWithError("setBehavior()");
782 }

References abortWithError.

◆ simulateTrigger()

bool NullOperation::simulateTrigger ( SimValue **  ,
OperationContext context 
) const
virtual

Aborts program with error log message.

Returns
False.
Exceptions
Exceptionnever.

Reimplemented from Operation.

Definition at line 932 of file Operation.cc.

934  {
935 
936  abortWithError("simulateTrigger()");
937  return false;
938 }

References abortWithError.

◆ usesMemory()

bool NullOperation::usesMemory ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operation.

Definition at line 834 of file Operation.cc.

834  {
835  abortWithError("usesMemory()");
836  return false;
837 }

References abortWithError.

◆ writesMemory()

bool NullOperation::writesMemory ( ) const
virtual

Aborts program with error log message.

Returns
False.

Reimplemented from Operation.

Definition at line 856 of file Operation.cc.

856  {
857  abortWithError("writesMemory()");
858  return false;
859 }

References abortWithError.

Member Data Documentation

◆ instance_

NullOperation NullOperation::instance_
staticprivate

Unique instance of NullOperation.

Definition at line 237 of file Operation.hh.


The documentation for this class was generated from the following files:
Operation::Operation
Operation(const TCEString &name, OperationBehavior &behavior)
Definition: Operation.cc:73
NullOperand::instance
static NullOperand & instance()
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
__func__
#define __func__
Definition: Application.hh:67
NullOperationBehavior::instance
static NullOperationBehavior & instance()
Definition: OperationBehavior.hh:95