Lines Matching defs:Expr
56 Expr *_cost_lb; // Cost lower bound for this production
57 Expr *_cost_ub; // Cost upper bound for this production
66 Expr *cost_lb() const { return (Expr *)_cost_lb; }
67 Expr *cost_ub() const { return (Expr *)_cost_ub; }
94 Expr *cost_lb(const char *result);
95 Expr *cost_ub(const char *result);
96 void set_cost_bounds(const char *result, const Expr *cost, bool has_state_check, bool has_cost_check);
118 const char *arrayIdx, const Expr *cost, const char *rule, ProductionState &status) {
125 const Expr *previous_ub = status.cost_ub(arrayIdx);
133 const Expr *previous_lb = status.cost_lb(arrayIdx);
213 Expr *ArchDesc::calc_cost(FILE *fp, const char *spaces, MatchList &mList, ProductionState &status) {
215 Expr *c = new Expr("0");
218 sprintf(Expr::buffer(), "_kids[0]->_cost[%s]", lchild_to_upper);
219 c->add(Expr::buffer());
224 sprintf(Expr::buffer(), "_kids[1]->_cost[%s]", rchild_to_upper);
225 c->add(Expr::buffer());
270 const Expr *cost = calc_cost(fp, spaces6, mList, status);
293 void ArchDesc::expand_opclass(FILE *fp, const char *indent, const Expr *cost,
302 // Expr *cCost = new Expr(cost);
312 const Expr *icost, const char *irule, Dict &operands_chained_from, ProductionState &status) {
333 Expr *total_cost = icost->clone(); // icost + cost
469 Expr::check_buffers();
626 const Expr *zeroCost = new Expr("0");
633 //------------------------------Expr------------------------------------------
634 Expr *Expr::_unknown_expr = NULL;
635 char Expr::string_buffer[STRING_BUFFER_LENGTH];
636 char Expr::external_buffer[STRING_BUFFER_LENGTH];
637 bool Expr::_init_buffers = Expr::init_buffers();
639 Expr::Expr() {
642 _min_value = Expr::Max;
643 _max_value = Expr::Zero;
645 Expr::Expr(const char *cost) {
651 _min_value = Expr::Zero;
652 _max_value = Expr::Zero;
662 _min_value = Expr::Zero;
663 _max_value = Expr::Max;
667 Expr::Expr(const char *name, const char *expression, int min_value, int max_value) {
672 assert(_min_value >= 0 && _min_value <= Expr::Max, "value out of range");
673 assert(_max_value >= 0 && _max_value <= Expr::Max, "value out of range");
676 Expr *Expr::clone() const {
677 Expr *cost = new Expr();
686 void Expr::add(const Expr *c) {
699 void Expr::add(const char *c) {
700 Expr *cost = new Expr(c);
704 void Expr::add(const char *c, ArchDesc &AD) {
705 const Expr *e = AD.globalDefs()[c];
710 Expr *cost = new Expr(c);
715 const char *Expr::compute_external(const Expr *c1, const Expr *c2) {
740 const char *Expr::compute_expr(const Expr *c1, const Expr *c2) {
759 int Expr::compute_min(const Expr *c1, const Expr *c2) {
766 int Expr::compute_max(const Expr *c1, const Expr *c2) {
769 result = Expr::Max;
775 void Expr::print() const {
783 void Expr::print_define(FILE *fp) const {
790 void Expr::print_assert(FILE *fp) const {
796 Expr *Expr::get_unknown() {
797 if( Expr::_unknown_expr == NULL ) {
798 Expr::_unknown_expr = new Expr();
801 return Expr::_unknown_expr;
804 bool Expr::init_buffers() {
814 bool Expr::check_buffers() {
820 assert( false, "Expr:: Buffer overflow");
836 // Return # of name-Expr pairs in dict
843 const Expr *ExprDict::define(const char *name, Expr *expr) {
844 const Expr *old_expr = (*this)[name];
855 const Expr *ExprDict::Insert(const char *name, Expr *expr) {
856 return (Expr*)_expr.Insert((void*)name, (void*)expr);
861 const Expr *ExprDict::operator [](const char *name) const {
862 return (Expr*)_expr[name];
869 const Expr *expr = (const Expr*)_expr[name];
870 assert( expr != NULL, "name in ExprDict without matching Expr in dictionary");
879 const Expr *expr = (const Expr*)_expr[name];
880 assert( expr != NULL, "name in ExprDict without matching Expr in dictionary");
887 static void dumpexpr(const void* expr) { fflush(stdout); ((Expr*)expr)->print(); }
928 _cost_lb = Expr::get_unknown();
929 _cost_ub = Expr::get_unknown();
989 Expr *ProductionState::cost_lb(const char *result) {
993 Expr *ProductionState::cost_ub(const char *result) {
997 void ProductionState::set_cost_bounds(const char *result, const Expr *cost, bool has_state_check, bool has_cost_check) {