C# Класс ABT.LogicalOr

Left || Right: can only take scalars (to compare with 0). After semantic analysis, each operand can only be long, ulong, float, double. Pointers are casted to ulongs. if Left != 0: return 1 else: return Right != 0 Generate the assembly in this fashion, then every route would only have one jump. +---------+ 1 | cmp lhs |-------+ +---------+ | | | | 0 | | | +----+----+ 1 | | cmp rhs |-------+ +---------+ | | | | 0 | | | +----+----+ | | eax = 0 | | +---------+ | | | +---------+ | | | | +------------+ label_set | | | +---------+ | | eax = 1 | | +---------+ | | +---------+ label_finish |
Показать файл Открыть проект

Открытые методы

Метод Описание
CGenValue ( CGenState state ) : System.Reg
LogicalOr ( Expr left, Expr right ) : System

Описание методов

CGenValue() публичный Метод

public CGenValue ( CGenState state ) : System.Reg
state CodeGeneration.CGenState
Результат System.Reg

LogicalOr() публичный Метод

public LogicalOr ( Expr left, Expr right ) : System
left Expr
right Expr
Результат System