|
Intel SPMD Program Compiler
1.3.0
|
Assignment expression. More...
#include <expr.h>


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 Type * | GetType () const |
| void | Print () const |
| Expr * | Optimize () |
| Expr * | TypeCheck () |
| int | EstimateCost () const |
Public Attributes | |
| const Op | op |
| Expr * | lvalue |
| Expr * | rvalue |
| enum AssignExpr::Op |
| AssignExpr::AssignExpr | ( | AssignExpr::Op | o, |
| Expr * | a, | ||
| Expr * | b, | ||
| SourcePos | p | ||
| ) |
| int AssignExpr::EstimateCost | ( | ) | const |
Definition at line 2914 of file expr.cpp.
References Assign, COST_ASSIGN, COST_COMPLEX_ARITH_OP, COST_SIMPLE_ARITH_LOGIC_OP, DivAssign, ModAssign, and op.
| 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] |
| 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] |
This method should perform type checking of the expression and return a pointer to the resulting expression. If an error is encountered, NULL should be returned.
Implements Expr.
Definition at line 2809 of file expr.cpp.
References AddAssign, AndAssign, AssertPos, Assign, Error(), Module::errorCount, g, Type::GetAsVaryingType(), Type::GetBaseType(), FunctionType::GetNumParameters(), FunctionType::GetParameterType(), Type::GetString(), StructType::GetString(), Expr::GetType(), Target::is32Bit, Type::IsConstType(), Type::IsFloatType(), Type::IsVaryingType(), PointerType::IsVoidPointer(), lCheckForConstStructMember(), lOpString(), lvalue, m, NULL, op, OrAssign, FunctionSymbolExpr::ResolveOverloads(), rvalue, ShlAssign, ShrAssign, SubAssign, Globals::target, TypeConvertExpr(), AtomicType::UniformInt32, AtomicType::UniformInt64, and XorAssign.
Definition at line 197 of file expr.h.
Referenced by AssignExpr(), GetType(), GetValue(), Optimize(), Print(), and TypeCheck().
| const Op AssignExpr::op |
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().
1.7.5.1