vlog95: Emit a new doing a shallow copy as an error.

This commit is contained in:
Cary R 2013-04-30 11:51:16 -07:00
parent c55eb37148
commit 431d62185b
2 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000-2012 Stephen Williams (steve@icarus.com) * Copyright (c) 2000-2013 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com) * Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
* *
* This source code is free software; you can redistribute it * This source code is free software; you can redistribute it
@ -308,6 +308,7 @@ static void elaborate_scope_class(Design*des, NetScope*scope,
// not allowed to escape a class method. // not allowed to escape a class method.
NetScope*class_scope = new NetScope(0, hname_t(pclass->pscope_name()), NetScope*class_scope = new NetScope(0, hname_t(pclass->pscope_name()),
NetScope::CLASS); NetScope::CLASS);
class_scope->set_line(pclass);
class_scope->set_class_def(use_class); class_scope->set_class_def(use_class);
use_class->set_class_scope(class_scope); use_class->set_class_scope(class_scope);

View File

@ -724,6 +724,15 @@ void emit_expr(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
fprintf(vlog_out, "%s", ivl_expr_name(expr)); fprintf(vlog_out, "%s", ivl_expr_name(expr));
emit_expr_func(scope, expr, wid); emit_expr_func(scope, expr, wid);
break; break;
case IVL_EX_SHALLOWCOPY:
fprintf(vlog_out, "<new> ");
emit_expr(scope, ivl_expr_oper2(expr), wid);
fprintf(stderr, "%s:%u: vlog95 error: New operator "
"is not supported.\n",
ivl_expr_file(expr),
ivl_expr_lineno(expr));
vlog_errors += 1;
break;
case IVL_EX_SIGNAL: case IVL_EX_SIGNAL:
emit_expr_signal(scope, expr, wid); emit_expr_signal(scope, expr, wid);
break; break;