Build errors in picky GCC compilers.

This commit is contained in:
steve 2007-06-04 19:14:06 +00:00
parent 129a064e1a
commit 8fd42fbf61
4 changed files with 36 additions and 26 deletions

23
PExpr.h
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: PExpr.h,v 1.89 2007/06/04 02:19:07 steve Exp $" #ident "$Id: PExpr.h,v 1.90 2007/06/04 19:14:06 steve Exp $"
#endif #endif
# include <string> # include <string>
@ -125,7 +125,7 @@ class PExpr : public LineInfo {
// This attempts to evaluate a constant expression, and return // This attempts to evaluate a constant expression, and return
// a verinum as a result. If the expression cannot be // a verinum as a result. If the expression cannot be
// evaluated, return 0. // evaluated, return 0.
virtual verinum* eval_const(const Design*des, NetScope*sc) const; virtual verinum* eval_const(Design*des, NetScope*sc) const;
// This method returns true if that expression is the same as // This method returns true if that expression is the same as
// this expression. This method is used for comparing // this expression. This method is used for comparing
@ -151,7 +151,7 @@ class PEConcat : public PExpr {
PEConcat(const svector<PExpr*>&p, PExpr*r =0); PEConcat(const svector<PExpr*>&p, PExpr*r =0);
~PEConcat(); ~PEConcat();
virtual verinum* eval_const(const Design*des, NetScope*sc) const; virtual verinum* eval_const(Design*des, NetScope*sc) const;
virtual void dump(ostream&) const; virtual void dump(ostream&) const;
virtual NetNet* elaborate_lnet(Design*des, NetScope*scope, virtual NetNet* elaborate_lnet(Design*des, NetScope*scope,
@ -222,7 +222,7 @@ class PEFNumber : public PExpr {
/* The eval_const method as applied to a floating point number /* The eval_const method as applied to a floating point number
gets the *integer* value of the number. This accounts for gets the *integer* value of the number. This accounts for
any rounding that is needed to get the value. */ any rounding that is needed to get the value. */
virtual verinum* eval_const(const Design*des, NetScope*sc) const; virtual verinum* eval_const(Design*des, NetScope*sc) const;
/* A PEFNumber is a constant, so this returns true. */ /* A PEFNumber is a constant, so this returns true. */
virtual bool is_constant(Module*) const; virtual bool is_constant(Module*) const;
@ -290,7 +290,7 @@ class PEIdent : public PExpr {
NetNet* elaborate_port(Design*des, NetScope*sc) const; NetNet* elaborate_port(Design*des, NetScope*sc) const;
virtual bool is_constant(Module*) const; virtual bool is_constant(Module*) const;
verinum* eval_const(const Design*des, NetScope*sc) const; verinum* eval_const(Design*des, NetScope*sc) const;
const pform_name_t& path() const { return path_; } const pform_name_t& path() const { return path_; }
@ -400,7 +400,7 @@ class PENumber : public PExpr {
NetScope*scope, NetScope*scope,
bool is_force) const; bool is_force) const;
virtual verinum* eval_const(const Design*des, NetScope*sc) const; virtual verinum* eval_const(Design*des, NetScope*sc) const;
virtual bool is_the_same(const PExpr*that) const; virtual bool is_the_same(const PExpr*that) const;
virtual bool is_constant(Module*) const; virtual bool is_constant(Module*) const;
@ -439,7 +439,7 @@ class PEString : public PExpr {
virtual NetEConst*elaborate_expr(Design*des, NetScope*, virtual NetEConst*elaborate_expr(Design*des, NetScope*,
int expr_width, bool) const; int expr_width, bool) const;
virtual NetEConst*elaborate_pexpr(Design*des, NetScope*sc) const; virtual NetEConst*elaborate_pexpr(Design*des, NetScope*sc) const;
verinum* eval_const(const Design*, NetScope*) const; verinum* eval_const(Design*, NetScope*) const;
virtual bool is_constant(Module*) const; virtual bool is_constant(Module*) const;
@ -465,7 +465,7 @@ class PEUnary : public PExpr {
virtual NetExpr*elaborate_expr(Design*des, NetScope*, virtual NetExpr*elaborate_expr(Design*des, NetScope*,
int expr_width, bool sys_task_arg) const; int expr_width, bool sys_task_arg) const;
virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const; virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const;
virtual verinum* eval_const(const Design*des, NetScope*sc) const; virtual verinum* eval_const(Design*des, NetScope*sc) const;
virtual bool is_constant(Module*) const; virtual bool is_constant(Module*) const;
@ -498,7 +498,7 @@ class PEBinary : public PExpr {
virtual NetEBinary*elaborate_expr(Design*des, NetScope*, virtual NetEBinary*elaborate_expr(Design*des, NetScope*,
int expr_width, bool sys_task_arg) const; int expr_width, bool sys_task_arg) const;
virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const; virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const;
virtual verinum* eval_const(const Design*des, NetScope*sc) const; virtual verinum* eval_const(Design*des, NetScope*sc) const;
protected: protected:
char op_; char op_;
@ -606,7 +606,7 @@ class PETernary : public PExpr {
virtual NetETernary*elaborate_expr(Design*des, NetScope*, virtual NetETernary*elaborate_expr(Design*des, NetScope*,
int expr_width, bool sys_task_arg) const; int expr_width, bool sys_task_arg) const;
virtual NetETernary*elaborate_pexpr(Design*des, NetScope*sc) const; virtual NetETernary*elaborate_pexpr(Design*des, NetScope*sc) const;
virtual verinum* eval_const(const Design*des, NetScope*sc) const; virtual verinum* eval_const(Design*des, NetScope*sc) const;
private: private:
PExpr*expr_; PExpr*expr_;
@ -657,6 +657,9 @@ class PECallFunction : public PExpr {
/* /*
* $Log: PExpr.h,v $ * $Log: PExpr.h,v $
* Revision 1.90 2007/06/04 19:14:06 steve
* Build errors in picky GCC compilers.
*
* Revision 1.89 2007/06/04 02:19:07 steve * Revision 1.89 2007/06/04 02:19:07 steve
* Handle bit/part select of array words in nets. * Handle bit/part select of array words in nets.
* *

23
eval.cc
View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: eval.cc,v 1.46 2007/05/24 04:07:12 steve Exp $" #ident "$Id: eval.cc,v 1.47 2007/06/04 19:14:06 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -29,12 +29,12 @@
# include "netmisc.h" # include "netmisc.h"
# include "compiler.h" # include "compiler.h"
verinum* PExpr::eval_const(const Design*, NetScope*) const verinum* PExpr::eval_const(Design*, NetScope*) const
{ {
return 0; return 0;
} }
verinum* PEBinary::eval_const(const Design*des, NetScope*scope) const verinum* PEBinary::eval_const(Design*des, NetScope*scope) const
{ {
verinum*l = left_->eval_const(des, scope); verinum*l = left_->eval_const(des, scope);
if (l == 0) return 0; if (l == 0) return 0;
@ -143,7 +143,7 @@ verinum* PEBinary::eval_const(const Design*des, NetScope*scope) const
delete r; delete r;
return res; return res;
} }
verinum* PEConcat::eval_const(const Design*des, NetScope*scope) const verinum* PEConcat::eval_const(Design*des, NetScope*scope) const
{ {
verinum*accum = parms_[0]->eval_const(des, scope); verinum*accum = parms_[0]->eval_const(des, scope);
if (accum == 0) if (accum == 0)
@ -170,7 +170,7 @@ verinum* PEConcat::eval_const(const Design*des, NetScope*scope) const
* Evaluate an identifier as a constant expression. This is only * Evaluate an identifier as a constant expression. This is only
* possible if the identifier is that of a parameter. * possible if the identifier is that of a parameter.
*/ */
verinum* PEIdent::eval_const(const Design*des, NetScope*scope) const verinum* PEIdent::eval_const(Design*des, NetScope*scope) const
{ {
assert(scope); assert(scope);
NetNet*net; NetNet*net;
@ -209,23 +209,23 @@ verinum* PEIdent::eval_const(const Design*des, NetScope*scope) const
return new verinum(eval->value()); return new verinum(eval->value());
} }
verinum* PEFNumber::eval_const(const Design*, NetScope*) const verinum* PEFNumber::eval_const(Design*, NetScope*) const
{ {
long val = value_->as_long(); long val = value_->as_long();
return new verinum(val); return new verinum(val);
} }
verinum* PENumber::eval_const(const Design*, NetScope*) const verinum* PENumber::eval_const(Design*, NetScope*) const
{ {
return new verinum(value()); return new verinum(value());
} }
verinum* PEString::eval_const(const Design*, NetScope*) const verinum* PEString::eval_const(Design*, NetScope*) const
{ {
return new verinum(string(text_)); return new verinum(string(text_));
} }
verinum* PETernary::eval_const(const Design*des, NetScope*scope) const verinum* PETernary::eval_const(Design*des, NetScope*scope) const
{ {
verinum*test = expr_->eval_const(des, scope); verinum*test = expr_->eval_const(des, scope);
if (test == 0) if (test == 0)
@ -245,7 +245,7 @@ verinum* PETernary::eval_const(const Design*des, NetScope*scope) const
} }
} }
verinum* PEUnary::eval_const(const Design*des, NetScope*scope) const verinum* PEUnary::eval_const(Design*des, NetScope*scope) const
{ {
verinum*val = expr_->eval_const(des, scope); verinum*val = expr_->eval_const(des, scope);
if (val == 0) if (val == 0)
@ -276,6 +276,9 @@ verinum* PEUnary::eval_const(const Design*des, NetScope*scope) const
/* /*
* $Log: eval.cc,v $ * $Log: eval.cc,v $
* Revision 1.47 2007/06/04 19:14:06 steve
* Build errors in picky GCC compilers.
*
* Revision 1.46 2007/05/24 04:07:12 steve * Revision 1.46 2007/05/24 04:07:12 steve
* Rework the heirarchical identifier parse syntax and pform * Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects. * to handle more general combinations of heirarch and bit selects.

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: eval_attrib.cc,v 1.8 2005/11/27 17:01:57 steve Exp $" #ident "$Id: eval_attrib.cc,v 1.9 2007/06/04 19:14:06 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -35,8 +35,7 @@
attrib_list_t* evaluate_attributes(const map<perm_string,PExpr*>&att, attrib_list_t* evaluate_attributes(const map<perm_string,PExpr*>&att,
unsigned&natt, unsigned&natt,
const Design*des, Design*des, NetScope*scope)
NetScope*scope)
{ {
natt = att.size(); natt = att.size();
if (natt == 0) if (natt == 0)
@ -74,6 +73,9 @@ attrib_list_t* evaluate_attributes(const map<perm_string,PExpr*>&att,
/* /*
* $Log: eval_attrib.cc,v $ * $Log: eval_attrib.cc,v $
* Revision 1.9 2007/06/04 19:14:06 steve
* Build errors in picky GCC compilers.
*
* Revision 1.8 2005/11/27 17:01:57 steve * Revision 1.8 2005/11/27 17:01:57 steve
* Fix for stubborn compiler. * Fix for stubborn compiler.
* *

8
util.h
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: util.h,v 1.8 2005/11/27 17:01:57 steve Exp $" #ident "$Id: util.h,v 1.9 2007/06/04 19:14:06 steve Exp $"
#endif #endif
# include <map> # include <map>
@ -46,11 +46,13 @@ struct attrib_list_t {
extern attrib_list_t* evaluate_attributes(const map<perm_string,PExpr*>&att, extern attrib_list_t* evaluate_attributes(const map<perm_string,PExpr*>&att,
unsigned&natt, unsigned&natt,
const Design*des, Design*des, NetScope*scope);
NetScope*scope);
/* /*
* $Log: util.h,v $ * $Log: util.h,v $
* Revision 1.9 2007/06/04 19:14:06 steve
* Build errors in picky GCC compilers.
*
* Revision 1.8 2005/11/27 17:01:57 steve * Revision 1.8 2005/11/27 17:01:57 steve
* Fix for stubborn compiler. * Fix for stubborn compiler.
* *