Polaris: BinaryExpr Class Reference

BinaryExpr Class Reference

An expression with two arguments. More...

#include <BinaryExpr.h>

Inheritance diagram for BinaryExpr:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 BinaryExpr (OP_TYPE o, const Type &etype, Expression *left_exp, Expression *right_exp)
 BinaryExpr (const BinaryExpr &e)
virtual ~BinaryExpr ()
 BinaryExpr code:.
BinaryExproperator= (const BinaryExpr &e)
virtual const Expressionleft_guarded () const
virtual Expressionleft_guarded ()
 Return a reference to the left argument.
virtual void left (Expression *)
 Set the left argument to the given expression.
virtual Boolean left_valid () const
 Return true if the left argument is valid.
virtual Expressiongrab_left ()
 Relinquish my ownership of my left argument and return it.
virtual const Expressionright_guarded () const
virtual Expressionright_guarded ()
 Return a reference to the right argument.
virtual void right (Expression *)
 Set the right argument to the given expression.
virtual Boolean right_valid () const
 Return true if the right argument is valid.
virtual Expressiongrab_right ()
 Relinquish my ownership of my right argument and return it.
virtual Expressionclone () const
 Return a copy of myself.
virtual Boolean args_are_non_null () const
 Return true if the unary or binary expression doesn't have any non-NULL subexpression arguments.
virtual const List< Expression > & arg_list () const
virtual List< Expression > & arg_list ()
 Return a reference to list of all expression arguments of myself.
virtual const RefList< Expression > * arg_refs () const
 Return a list of references to all expression arguments of myself.
virtual int structures_OK () const
 Return 1 if my structures are in a valid state.
virtual void convert (BinRep &exprSet, Symtab &symtab)
 Read in the values of my fields and my subexpressions from the given BinRep object.
virtual void print_debug (ostream &o, Boolean debug) const
 See Expression.h.
virtual int exchange_expr (VDL &vdl)
 Create a node in the "expression" member and return the index.

Protected Member Functions

 BinaryExpr (OP_TYPE o, const Type &etype)
const Expression_left_guarded () const
Expression_left_guarded ()
void _left (Expression *)
Boolean _left_valid () const
Expression_grab_left ()
const Expression_right_guarded () const
Expression_right_guarded ()
void _right (Expression *)
Boolean _right_valid () const
Expression_grab_right ()
virtual Expression_fold_top ()
virtual Boolean _args_are_equal (Expression &, Boolean consider_side_effects)

Friends

class ExprTable

Detailed Description

An expression with two arguments.

Polaris Expression

See also:
Expression/BinaryExpr.h

Expression/BinaryExpr.h

Expression/Expression.cc

Description

A BinaryExpr is an expression with two arguments. These arguments are named left and right. A BinaryExpr can be one of several kinds of expressions. The most common of these are are SUB_OP (-), DIV_OP (/), EXP_OP (**), or one of the relational operators.

Definition at line 34 of file BinaryExpr.h.


Constructor & Destructor Documentation

BinaryExpr::BinaryExpr OP_TYPE  o,
const Type etype,
Expression left_exp,
Expression right_exp
[inline]
 

< nothing to do

Definition at line 125 of file BinaryExpr.h.

References null_to_omega().

Referenced by clone().

BinaryExpr::BinaryExpr const BinaryExpr e  )  [inline]
 

Definition at line 134 of file BinaryExpr.h.

References e, and List< T >::fix_size().

BinaryExpr::~BinaryExpr  )  [virtual]
 

BinaryExpr code:.

... nothing to do

Definition at line 3538 of file Expression.cc.

BinaryExpr::BinaryExpr OP_TYPE  o,
const Type etype
[inline, protected]
 

< nothing to do

Definition at line 118 of file BinaryExpr.h.


Member Function Documentation

BinaryExpr & BinaryExpr::operator= const BinaryExpr e  ) 
 

Definition at line 3550 of file Expression.cc.

References _left(), _right(), DistributeExpr::clone(), and e.

Referenced by RangeExpr::operator=(), SubStringExpr::operator=(), GSAExpr::operator=(), LambdaCallExpr::operator=(), IntrinsicCallExpr::operator=(), FunctionCallExpr::operator=(), EqualExpr::operator=(), DoExpr::operator=(), ComplexExpr::operator=(), and ArrayRefExpr::operator=().

const Expression & BinaryExpr::left_guarded  )  const [virtual]
 

Reimplemented from Expression.

Definition at line 3588 of file Expression.cc.

References _left_guarded().

Expression & BinaryExpr::left_guarded  )  [virtual]
 

Return a reference to the left argument.

Reimplemented from Expression.

Definition at line 3594 of file Expression.cc.

References _left_guarded().

void BinaryExpr::left Expression  )  [virtual]
 

Set the left argument to the given expression.

Reimplemented from Expression.

Definition at line 3582 of file Expression.cc.

References _left(), and e.

Boolean BinaryExpr::left_valid  )  const [virtual]
 

Return true if the left argument is valid.

Reimplemented from Expression.

Definition at line 3600 of file Expression.cc.

References _left_valid().

Expression * BinaryExpr::grab_left  )  [virtual]
 

Relinquish my ownership of my left argument and return it.

My left argument will now be marked as invalid.

Reimplemented from Expression.

Definition at line 3606 of file Expression.cc.

References _grab_left().

const Expression & BinaryExpr::right_guarded  )  const [virtual]
 

Reimplemented from Expression.

Definition at line 3618 of file Expression.cc.

References _right_guarded().

Expression & BinaryExpr::right_guarded  )  [virtual]
 

Return a reference to the right argument.

Reimplemented from Expression.

Definition at line 3624 of file Expression.cc.

References _right_guarded().

void BinaryExpr::right Expression  )  [virtual]
 

Set the right argument to the given expression.

Reimplemented from Expression.

Definition at line 3612 of file Expression.cc.

References _right(), and e.

Boolean BinaryExpr::right_valid  )  const [virtual]
 

Return true if the right argument is valid.

Reimplemented from Expression.

Definition at line 3630 of file Expression.cc.

References _right_valid().

Expression * BinaryExpr::grab_right  )  [virtual]
 

Relinquish my ownership of my right argument and return it.

My right argument will now be marked as invalid.

Reimplemented from Expression.

Definition at line 3636 of file Expression.cc.

References _grab_right().

Expression * BinaryExpr::clone  )  const [virtual]
 

Return a copy of myself.

Implements Expression.

Reimplemented in ArrayRefExpr, ComplexExpr, DoExpr, EqualExpr, FunctionCallExpr, GSAExpr, IntrinsicCallExpr, LambdaCallExpr, SSAExpr, SubStringExpr, and RangeExpr.

Definition at line 3544 of file Expression.cc.

References BinaryExpr().

Boolean BinaryExpr::args_are_non_null  )  const [virtual]
 

Return true if the unary or binary expression doesn't have any non-NULL subexpression arguments.

Reimplemented from Expression.

Definition at line 3642 of file Expression.cc.

References _left_valid(), and _right_valid().

const List< Expression > & BinaryExpr::arg_list  )  const [virtual]
 

... List of no arguments

Reimplemented from Expression.

Definition at line 3648 of file Expression.cc.

Referenced by IntrinsicCallExpr::_combine_top(), and replace_lambda_call().

List< Expression > & BinaryExpr::arg_list  )  [virtual]
 

Return a reference to list of all expression arguments of myself.

... List of no arguments

Reimplemented from Expression.

Definition at line 3654 of file Expression.cc.

const RefList< Expression > * BinaryExpr::arg_refs  )  const [virtual]
 

Return a list of references to all expression arguments of myself.

This method is outdated. Use arg_list() instead.

Reimplemented from Expression.

Definition at line 3568 of file Expression.cc.

References _left_guarded(), _left_valid(), _right_guarded(), _right_valid(), and RefList< T >::ins_last().

int BinaryExpr::structures_OK  )  const [virtual]
 

Return 1 if my structures are in a valid state.

Implements Expression.

Reimplemented in ArrayRefExpr, ComplexExpr, DoExpr, EqualExpr, FunctionCallExpr, GSAExpr, IntrinsicCallExpr, LambdaCallExpr, SSAExpr, SubStringExpr, and RangeExpr.

Definition at line 3660 of file Expression.cc.

References True.

virtual void BinaryExpr::convert BinRep exprSet,
Symtab symtab
[virtual]
 

Read in the values of my fields and my subexpressions from the given BinRep object.

Convert(BinRep) expects the BinRep to be referencing an expression set of the same type as the expression. On return, all data from the expression set has been inserted into the appropriate fields in the expression object. NOTE that this converts the expression to an intermediate form which may contain TableExpr objects.

Implements Expression.

Reimplemented in ArrayRefExpr, ComplexExpr, DoExpr, EqualExpr, FunctionCallExpr, GSAExpr, IntrinsicCallExpr, LambdaCallExpr, SSAExpr, SubStringExpr, and RangeExpr.

Referenced by exchange_expr().

virtual void BinaryExpr::print_debug ostream &  o,
Boolean  debug
const [virtual]
 

See Expression.h.

Implements Expression.

Reimplemented in ArrayRefExpr, ComplexExpr, DoExpr, EqualExpr, FunctionCallExpr, GSAExpr, IntrinsicCallExpr, LambdaCallExpr, SSAExpr, SubStringExpr, and RangeExpr.

int BinaryExpr::exchange_expr VDL vdl  )  [virtual]
 

Create a node in the "expression" member and return the index.

Reimplemented from Expression.

Reimplemented in ArrayRefExpr, ComplexExpr, DoExpr, EqualExpr, FunctionCallExpr, GSAExpr, IntrinsicCallExpr, LambdaCallExpr, SSAExpr, and SubStringExpr.

Definition at line 3667 of file Expression.cc.

References CONCAT_OP, convert(), DIV_OP, EQ_OP, Expression::exchange_expr(), EXP_OP, BinRep::find_ref(), GE_OP, GT_OP, INTDIV_OP, LE_OP, LT_OP, NE_OP, Expression::op(), RATDIV_OP, SUB_OP, and BinRep::to_tuple().

const Expression & BinaryExpr::_left_guarded  )  const [inline, protected]
 

Definition at line 148 of file BinaryExpr.h.

References List< T >::valid().

Referenced by _args_are_equal(), _fold_top(), arg_refs(), ArrayRefExpr::array(), FunctionCallExpr::function(), GSAExpr::gate(), RangeExpr::has_lb(), EqualExpr::index_id(), IntrinsicCallExpr::intrinsic(), DoExpr::iolist(), LambdaCallExpr::lambda_expr(), RangeExpr::lb(), left_guarded(), ComplexExpr::real_part(), and SubStringExpr::string().

Expression & BinaryExpr::_left_guarded  )  [inline, protected]
 

Definition at line 157 of file BinaryExpr.h.

References List< T >::valid().

void BinaryExpr::_left Expression  )  [inline, protected]
 

Definition at line 142 of file BinaryExpr.h.

References e, List< T >::modify(), and null_to_omega().

Referenced by ArrayRefExpr::array(), FunctionCallExpr::function(), GSAExpr::gate(), EqualExpr::index_id(), IntrinsicCallExpr::intrinsic(), DoExpr::iolist(), LambdaCallExpr::lambda_expr(), RangeExpr::lb(), left(), operator=(), ComplexExpr::real_part(), and SubStringExpr::string().

Boolean BinaryExpr::_left_valid  )  const [inline, protected]
 

Definition at line 166 of file BinaryExpr.h.

References List< T >::valid().

Referenced by _args_are_equal(), _fold_top(), arg_refs(), args_are_non_null(), and left_valid().

Expression * BinaryExpr::_grab_left  )  [inline, protected]
 

Definition at line 172 of file BinaryExpr.h.

References List< T >::grab().

Referenced by _fold_top(), RangeExpr::grab_lb(), and grab_left().

const Expression & BinaryExpr::_right_guarded  )  const [inline, protected]
 

Definition at line 184 of file BinaryExpr.h.

References List< T >::valid().

Referenced by _args_are_equal(), _fold_top(), arg_refs(), SubStringExpr::bound(), RangeExpr::has_ub(), ComplexExpr::imaginary_part(), EqualExpr::iteration_space(), DoExpr::iterator(), GSAExpr::parameters_guarded(), LambdaCallExpr::parameters_guarded(), IntrinsicCallExpr::parameters_guarded(), FunctionCallExpr::parameters_guarded(), right_guarded(), ArrayRefExpr::subscript(), and RangeExpr::ub().

Expression & BinaryExpr::_right_guarded  )  [inline, protected]
 

Definition at line 193 of file BinaryExpr.h.

References List< T >::valid().

void BinaryExpr::_right Expression  )  [inline, protected]
 

Definition at line 178 of file BinaryExpr.h.

References e, List< T >::modify(), and null_to_omega().

Referenced by SubStringExpr::bound(), ComplexExpr::imaginary_part(), EqualExpr::iteration_space(), DoExpr::iterator(), operator=(), GSAExpr::parameters(), LambdaCallExpr::parameters(), IntrinsicCallExpr::parameters(), FunctionCallExpr::parameters(), right(), ArrayRefExpr::subscript(), and RangeExpr::ub().

Boolean BinaryExpr::_right_valid  )  const [inline, protected]
 

Definition at line 202 of file BinaryExpr.h.

References List< T >::valid().

Referenced by _args_are_equal(), _fold_top(), arg_refs(), args_are_non_null(), GSAExpr::parameters_valid(), LambdaCallExpr::parameters_valid(), IntrinsicCallExpr::parameters_valid(), FunctionCallExpr::parameters_valid(), and right_valid().

Expression * BinaryExpr::_grab_right  )  [inline, protected]
 

Definition at line 208 of file BinaryExpr.h.

References List< T >::grab().

Referenced by _fold_top(), grab_right(), and RangeExpr::grab_ub().

Expression * BinaryExpr::_fold_top void   )  [protected, virtual]
 

... Do nothing

Reimplemented from Expression.

Reimplemented in IntrinsicCallExpr.

Definition at line 9683 of file Expression.cc.

References _expr_can_contain_omega(), _grab_left(), _grab_right(), _left_guarded(), _left_valid(), _right_guarded(), _right_valid(), _simplify_options, DIV_OP, EQ_OP, EXP_OP, GE_OP, GT_OP, INTDIV_OP, LE_OP, LT_OP, NE_OP, OMEGA_OP, Expression::op(), RATDIV_OP, and SUB_OP.

Boolean BinaryExpr::_args_are_equal Expression e,
Boolean  consider_side_effects
[protected, virtual]
 

... Clear any matches which might have been found by ... wildcards in the left arguments

Reimplemented from Expression.

Definition at line 8533 of file Expression.cc.

References Expression::_backup(), _left_guarded(), _left_valid(), _right_guarded(), _right_valid(), e, False, Expression::left_guarded(), Expression::left_valid(), Expression::right_guarded(), Expression::right_valid(), and wildcard_compare_args().


Friends And Related Function Documentation

friend class ExprTable [friend]
 

Reimplemented in ArrayRefExpr, ComplexExpr, DoExpr, EqualExpr, FunctionCallExpr, IntrinsicCallExpr, LambdaCallExpr, and SubStringExpr.

Definition at line 35 of file BinaryExpr.h.


The documentation for this class was generated from the following files:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:07:02 2005