Add file / line number information to functions
This commit is contained in:
parent
10a5ca199d
commit
49a2693357
|
|
@ -543,6 +543,11 @@ static int draw_function(ivl_scope_t scope, ivl_scope_t parent)
|
|||
// another function that has already been added
|
||||
ent->get_arch()->get_scope()->add_forward_decl
|
||||
(new vhdl_forward_fdecl(func));
|
||||
|
||||
ostringstream ss;
|
||||
ss << "Generated from function " << funcname << " at "
|
||||
<< ivl_scope_def_file(scope) << ":" << ivl_scope_def_lineno(scope);
|
||||
func->set_comment(ss.str().c_str());
|
||||
|
||||
ent->get_arch()->get_scope()->add_decl(func);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -823,6 +823,7 @@ vhdl_function::vhdl_function(const char *name, vhdl_type *ret_type)
|
|||
void vhdl_function::emit(std::ostream &of, int level) const
|
||||
{
|
||||
newline(of, level);
|
||||
emit_comment(of, level);
|
||||
of << "function " << name_ << " (";
|
||||
emit_children<vhdl_decl>(of, scope_.get_decls(), level, ";");
|
||||
of << ") ";
|
||||
|
|
|
|||
Loading…
Reference in New Issue