Skip to content

Commit 3c7393e

Browse files
committed
verilog_synthesist::expand_function_call now returns a value
1 parent 9d8dc69 commit 3c7393e

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/verilog/verilog_synthesis.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ exprt verilog_synthesist::synth_expr(exprt expr, symbol_statet symbol_state)
7676
}
7777
else if(expr.id()==ID_function_call)
7878
{
79-
expand_function_call(to_function_call_expr(expr));
80-
return expr;
79+
return expand_function_call(to_function_call_expr(expr));
8180
}
8281
else if(expr.id()==ID_hierarchical_identifier)
8382
{
@@ -122,7 +121,7 @@ Function: verilog_synthesist::expand_function_call
122121
123122
\*******************************************************************/
124123

125-
void verilog_synthesist::expand_function_call(function_call_exprt &call)
124+
exprt verilog_synthesist::expand_function_call(const function_call_exprt &call)
126125
{
127126
// Is it a 'system function call'?
128127
if(call.is_system_function_call())
@@ -138,8 +137,7 @@ void verilog_synthesist::expand_function_call(function_call_exprt &call)
138137
throw 0;
139138
}
140139

141-
call.swap(result);
142-
return;
140+
return result;
143141
}
144142

145143
// check some restrictions
@@ -203,9 +201,7 @@ void verilog_synthesist::expand_function_call(function_call_exprt &call)
203201
ns.lookup(id2string(symbol.name)+"."+
204202
id2string(symbol.base_name));
205203

206-
exprt return_value=return_symbol.symbol_expr();
207-
208-
call.swap(return_value);
204+
return return_symbol.symbol_expr();
209205
}
210206

211207
/*******************************************************************\

src/verilog/verilog_synthesis_class.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ class verilog_synthesist:
277277
class hierarchical_identifier_exprt &expr,
278278
symbol_statet symbol_state);
279279

280-
void expand_function_call(class function_call_exprt &call);
281-
280+
exprt expand_function_call(const class function_call_exprt &call);
281+
282282
typedef std::map<irep_idt, exprt> replace_mapt;
283283

284284
void instantiate_ports(

0 commit comments

Comments
 (0)