Intel SPMD Program Compiler  1.3.0
Public Types | Public Member Functions | Public Attributes
AssignExpr Class Reference

Assignment expression. More...

#include <expr.h>

Inheritance diagram for AssignExpr:
Inheritance graph
[legend]
Collaboration diagram for AssignExpr:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Op {
  Assign, MulAssign, DivAssign, ModAssign,
  AddAssign, SubAssign, ShlAssign, ShrAssign,
  AndAssign, XorAssign, OrAssign
}

Public Member Functions

 AssignExpr (Op o, Expr *a, Expr *b, SourcePos p)
llvm::Value * GetValue (FunctionEmitContext *ctx) const
const TypeGetType () const
void Print () const
ExprOptimize ()
ExprTypeCheck ()
int EstimateCost () const

Public Attributes

const Op op
Exprlvalue
Exprrvalue

Detailed Description

Assignment expression.

Definition at line 170 of file expr.h.


Member Enumeration Documentation

Enumerator:
Assign 

Regular assignment.

MulAssign 

*= assignment

DivAssign 

/= assignment

ModAssign 

%= assignment

AddAssign 

+= assignment

SubAssign 

-= assignment

ShlAssign 

<<= assignment

ShrAssign 

>>= assignment

AndAssign 

&= assignment

XorAssign 

^= assignment

OrAssign 

|= assignment

Definition at line 172 of file expr.h.


Constructor & Destructor Documentation

AssignExpr::AssignExpr ( AssignExpr::Op  o,
Expr a,
Expr b,
SourcePos  p 
)

Definition at line 2697 of file expr.cpp.

References lvalue, and rvalue.


Member Function Documentation

int AssignExpr::EstimateCost ( ) const
const Type * AssignExpr::GetType ( ) const [virtual]

Returns the Type of the expression.

Implements Expr.

Definition at line 2772 of file expr.cpp.

References Expr::GetType(), lvalue, and NULL.

Referenced by GetValue(), and Print().

llvm::Value * AssignExpr::GetValue ( FunctionEmitContext ctx) const [virtual]

This is the main method for Expr implementations to implement. It should call methods in the FunctionEmitContext to emit LLVM IR instructions to the current basic block in order to generate an llvm::Value that represents the expression's value.

Implements Expr.

Definition at line 2705 of file expr.cpp.

References AddAssign, AndAssign, AssertPos, Assign, DivAssign, Error(), Module::errorCount, FATAL, Expr::GetBaseSymbol(), Expr::GetLValue(), Expr::GetLValueType(), Expr::GetType(), GetType(), Expr::GetValue(), lEmitOpAssign(), lStoreAssignResult(), lvalue, m, ModAssign, MulAssign, NULL, op, OrAssign, rvalue, FunctionEmitContext::SetDebugPos(), ShlAssign, ShrAssign, SubAssign, and XorAssign.

Expr * AssignExpr::Optimize ( ) [virtual]

This method should perform early optimizations of the expression (constant folding, etc.) and return a pointer to the resulting expression. If an error is encountered during optimization, NULL should be returned.

Implements Expr.

Definition at line 2764 of file expr.cpp.

References lvalue, NULL, and rvalue.

void AssignExpr::Print ( ) const [virtual]

Prints the expression to standard output (used for debugging).

Implements Expr.

Definition at line 2925 of file expr.cpp.

References GetType(), lOpString(), lvalue, op, Expr::Print(), SourcePos::Print(), and rvalue.

Expr * AssignExpr::TypeCheck ( ) [virtual]

Member Data Documentation

Definition at line 197 of file expr.h.

Referenced by AssignExpr(), GetType(), GetValue(), Optimize(), Print(), and TypeCheck().

Definition at line 196 of file expr.h.

Referenced by EstimateCost(), GetValue(), Print(), and TypeCheck().

Definition at line 197 of file expr.h.

Referenced by AssignExpr(), GetValue(), Optimize(), Print(), and TypeCheck().


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