Permalink
Browse files

Propagate file and line information in more places.

There where a few places that were not propagating the file and
line information.
  • Loading branch information...
1 parent 75df8fb commit 70c5c9fe149067b45aa49b1bfc8bc624d387fa36 @caryr caryr committed with Feb 27, 2008
Showing with 26 additions and 9 deletions.
  1. +20 −6 dup_expr.cc
  2. +6 −3 elab_pexpr.cc
View
@@ -24,28 +24,33 @@
NetEBComp* NetEBComp::dup_expr() const
{
- NetEBComp*result = new NetEBComp(op_, left_->dup_expr(),
- right_->dup_expr());
- return result;
+ NetEBComp*tmp = new NetEBComp(op_, left_->dup_expr(),
+ right_->dup_expr());
+ assert(tmp);
+ tmp->set_line(*this);
+ return tmp;
}
NetEConst* NetEConst::dup_expr() const
{
NetEConst*tmp = new NetEConst(value_);
+ assert(tmp);
tmp->set_line(*this);
return tmp;
}
NetEConstParam* NetEConstParam::dup_expr() const
{
NetEConstParam*tmp = new NetEConstParam(scope_, name_, value());
+ assert(tmp);
tmp->set_line(*this);
return tmp;
}
NetECRealParam* NetECRealParam::dup_expr() const
{
NetECRealParam*tmp = new NetECRealParam(scope_, name_, value());
+ assert(tmp);
tmp->set_line(*this);
return tmp;
}
@@ -64,9 +69,12 @@ NetEScope* NetEScope::dup_expr() const
NetESelect* NetESelect::dup_expr() const
{
- return new NetESelect(expr_->dup_expr(),
- base_? base_->dup_expr() : 0,
- expr_width());
+ NetESelect*tmp = new NetESelect(expr_->dup_expr(),
+ base_? base_->dup_expr() : 0,
+ expr_width());
+ assert(tmp);
+ tmp->set_line(*this);
+ return tmp;
}
NetESFunc* NetESFunc::dup_expr() const
@@ -80,6 +88,7 @@ NetESFunc* NetESFunc::dup_expr() const
tmp->parm(idx, tmp->parm(idx)->dup_expr());
}
+ tmp->set_line(*this);
return tmp;
}
@@ -96,6 +105,8 @@ NetETernary* NetETernary::dup_expr() const
NetETernary*tmp = new NetETernary(cond_->dup_expr(),
true_val_->dup_expr(),
false_val_->dup_expr());
+ assert(tmp);
+ tmp->set_line(*this);
return tmp;
}
@@ -112,19 +123,22 @@ NetEUFunc* NetEUFunc::dup_expr() const
tmp = new NetEUFunc(scope_, func_, result_sig_->dup_expr(), tmp_parms);
assert(tmp);
+ tmp->set_line(*this);
return tmp;
}
NetEUnary* NetEUnary::dup_expr() const
{
NetEUnary*tmp = new NetEUnary(op_, expr_->dup_expr());
assert(tmp);
+ tmp->set_line(*this);
return tmp;
}
NetEUReduce* NetEUReduce::dup_expr() const
{
NetEUReduce*tmp = new NetEUReduce(op_, expr_->dup_expr());
assert(tmp);
+ tmp->set_line(*this);
return tmp;
}
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000-2007 Stephen Williams (steve@icarus.com)
+ * Copyright (c) 2000-2008 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -187,6 +187,7 @@ NetExpr*PEIdent::elaborate_pexpr(Design*des, NetScope*scope) const
NetExpr*tmp = name_tail.index.back().msb->elaborate_pexpr(des, scope);
if (tmp != 0) {
res = new NetESelect(res, tmp, 1);
+ res->set_line(*this);
}
break;
}
@@ -216,7 +217,10 @@ NetETernary* PETernary::elaborate_pexpr(Design*des, NetScope*scope) const
if (c == 0) return 0;
if (t == 0) return 0;
if (f == 0) return 0;
- return new NetETernary(c, t, f);
+
+ NetETernary*tmp = new NetETernary(c, t, f);
+ tmp->set_line(*this);
+ return tmp;
}
NetExpr*PEUnary::elaborate_pexpr (Design*des, NetScope*scope) const
@@ -251,4 +255,3 @@ NetExpr*PEUnary::elaborate_pexpr (Design*des, NetScope*scope) const
}
return tmp;
}
-

0 comments on commit 70c5c9f

Please sign in to comment.