Add file / line number information to functions

This commit is contained in:
Nick Gasson 2008-08-03 14:46:57 +01:00
parent 10a5ca199d
commit 49a2693357
2 changed files with 6 additions and 0 deletions

View File

@ -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;

View File

@ -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 << ") ";