HLVM API Documentation

Operator Class Reference

AST Abstract Operator Node. More...

#include <Operator.h>

Inheritance diagram for Operator:

Inheritance graph
[legend]
List of all members.

Accessors

Public Member Functions

Mutators

Protected Member Functions

Constructors

Friends


Detailed Description

AST Abstract Operator Node.

This class is the abstract base class in the Abstract Syntax Tree for all operators. An Operator is an instruction to the virtual machine to take some action. Operators form the content of a Block. As this is the base class of all operators, the Operator class only provides the functionality that is common to all operators: getting the number of operands (getNumOperands), getting the Value of an operand (getOperand), and setting the Value of an operand (setOperand). Since Operand is a Value, this implies two things: (1) Operators can be the operand of other operators and (2) eery Operator has a type.

See also:
Value

Block

Definition at line 57 of file Operator.h.


Constructor & Destructor Documentation

Operator NodeIDs  opID  )  [inline, protected]
 

Definition at line 62 of file Operator.h.

~Operator  )  [protected, virtual]
 

Definition at line 41 of file Operator.cpp.


Member Function Documentation

static bool classof const Node N  )  [inline, static]
 

Provide support for isa<X> and friends.

Reimplemented from Value.

Reimplemented in NegateOp, ComplementOp, PreIncrOp, PostIncrOp, PreDecrOp, PostDecrOp, SizeOfOp, LengthOp, ConvertOp, AddOp, SubtractOp, MultiplyOp, DivideOp, ModuloOp, BAndOp, BOrOp, BXorOp, BNorOp, Block, ResultOp, NotOp, AndOp, OrOp, NorOp, XorOp, LessThanOp, GreaterThanOp, LessEqualOp, GreaterEqualOp, EqualityOp, InequalityOp, SelectOp, SwitchOp, WhileOp, UnlessOp, UntilOp, LoopOp, ReturnOp, BreakOp, ContinueOp, CallOp, OpenOp, CloseOp, ReadOp, WriteOp, AllocateOp, DeallocateOp, LoadOp, StoreOp, AutoVarOp, GetOp, GetFieldOp, GetIndexOp, NilaryOperator, UnaryOperator, BinaryOperator, TernaryOperator, MultiOperator, IsPInfOp, IsNInfOp, IsNanOp, TruncOp, RoundOp, FloorOp, CeilingOp, LogEOp, Log2Op, Log10Op, SquareRootOp, CubeRootOp, FactorialOp, PowerOp, RootOp, GCDOp, LCMOp, StrInsertOp, StrEraseOp, StrReplaceOp, and StrConcatOp.

Definition at line 86 of file Operator.h.

References Node::isOperator().

static bool classof const Operator  )  [inline, static]
 

Determine if this is a classof some other type.

Definition at line 85 of file Operator.h.

Block * getContainingBlock  )  const
 

Return the block containing this operator.

Definition at line 56 of file Operator.cpp.

References Node::getParent().

Function * getContainingFunction  )  const
 

Return the function containing this operator.

Definition at line 46 of file Operator.cpp.

References Node::getParent(), and Node::isFunction().

Operator * getContainingLoop  )  const
 

Return the loop operator containing this operator. This can return any of the loop constructs (Loop, While, Unless, etc.) so its result type is Operator*.

Definition at line 66 of file Operator.cpp.

References Node::getParent(), and Node::isLoop().

virtual size_t getNumOperands  )  const [pure virtual]
 

Get a specific operand of this operator.

Implemented in NilaryOperator, UnaryOperator, BinaryOperator, TernaryOperator, and MultiOperator.

virtual Operator* getOperand unsigned  opnum  )  const [pure virtual]
 

Implemented in NilaryOperator, UnaryOperator, BinaryOperator, TernaryOperator, and MultiOperator.

virtual void setOperand unsigned  opnum,
Operator oprnd
[pure virtual]
 

Implemented in NilaryOperator, UnaryOperator, BinaryOperator, TernaryOperator, and MultiOperator.


Friends And Related Function Documentation

friend class AST [friend]
 

Reimplemented from Value.

Reimplemented in NegateOp, ComplementOp, PreIncrOp, PostIncrOp, PreDecrOp, PostDecrOp, SizeOfOp, LengthOp, ConvertOp, AddOp, SubtractOp, MultiplyOp, DivideOp, ModuloOp, BAndOp, BOrOp, BXorOp, BNorOp, Block, ResultOp, NotOp, AndOp, OrOp, NorOp, XorOp, LessThanOp, GreaterThanOp, LessEqualOp, GreaterEqualOp, EqualityOp, InequalityOp, SelectOp, SwitchOp, WhileOp, UnlessOp, UntilOp, LoopOp, ReturnOp, BreakOp, ContinueOp, CallOp, OpenOp, CloseOp, ReadOp, WriteOp, AllocateOp, DeallocateOp, LoadOp, StoreOp, AutoVarOp, GetOp, GetFieldOp, GetIndexOp, NilaryOperator, UnaryOperator, BinaryOperator, TernaryOperator, MultiOperator, IsPInfOp, IsNInfOp, IsNanOp, TruncOp, RoundOp, FloorOp, CeilingOp, LogEOp, Log2Op, Log10Op, SquareRootOp, CubeRootOp, FactorialOp, PowerOp, RootOp, GCDOp, LCMOp, StrInsertOp, StrEraseOp, StrReplaceOp, and StrConcatOp.

Definition at line 95 of file Operator.h.


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