updated dvm

This commit is contained in:
ALEXks
2025-01-24 17:33:55 +03:00
committed by Dudarenko
parent d2f5e5fcc1
commit 44600a50c1
5 changed files with 36 additions and 19 deletions

View File

@@ -27,6 +27,7 @@ int do_stmtfn = 0;
int gcount = 0;
int has_generic_interface = 0;
int in_region = 0;
int in_routine = 0;
//-----------------------------------------------------------------------------------------
graph_node *GraphNode(SgSymbol *s, SgStatement *header_st, int flag_new);
graph_node *NodeForSymbInGraph(SgSymbol *s, SgStatement *stheader);
@@ -1136,6 +1137,7 @@ SgStatement *Subprogram(SgStatement *func)
DECL(func->symbol()) = 1;
HEDR(func->symbol()) = func->thebif;
cur_func = func;
in_routine = 0;
//if( func->variant() == PROG_HEDR)
// PROGRAM_HEADER(func->symbol()) = func->thebif;
@@ -1175,7 +1177,9 @@ SgStatement *Subprogram(SgStatement *func)
case PAUSE_NODE:
case GOTO_NODE: // GO TO
break;
case ACC_ROUTINE_DIR:
in_routine = 1;
break;
case VAR_DECL:
case SWITCH_NODE: // SELECT CASE ...
case ARITHIF_NODE: // Arithmetical IF
@@ -1240,9 +1244,8 @@ END_:
// for debugging
if (deb_reg > 1)
PrintGraphNode(cur_node);
in_routine = 0;
return(last);
}
void FunctionCallSearch(SgExpression *e)
@@ -1605,6 +1608,7 @@ void Call_Site(SgSymbol *s, int inlined, SgStatement *stat, SgExpression *e)
{
graph_node * gnode, *node_by_attr = NULL;
SgSymbol *s_new = s;
SgStatement *interface_st = NULL;
//printf("\n%s id= %d \n", s->identifier(), s->id());
if (!do_dummy && isDummyArgument(s)) return;
if (!do_stmtfn && isStatementFunction(s)) return;
@@ -1614,7 +1618,7 @@ void Call_Site(SgSymbol *s, int inlined, SgStatement *stat, SgExpression *e)
if(s->variant() == INTERFACE_NAME && in_region)
{
//printf("INTERFACE_NAME %s\n",s->identifier());
SgStatement *interface_st = getGenericInterface(s, stat ? stat->expr(0) : e->lhs());
interface_st = getGenericInterface(s, stat ? stat->expr(0) : e->lhs());
SgSymbol *s_gen = s;
if(!interface_st)
{
@@ -1648,7 +1652,12 @@ void Call_Site(SgSymbol *s, int inlined, SgStatement *stat, SgExpression *e)
s_new->addAttribute(GRAPH_NODE, (void*)pnode, sizeof(graph_node *));
}
if (gnode->st_header)
MarkAsUserProcedure(s_new);
MarkAsUserProcedure(s_new);
else if (in_routine && (interface_st || (interface_st = getInterface(s_new))))
{
SaveInterface(s_new, interface_st);
MarkAsUserProcedure(s_new);
}
//printf(" call site on line %d: %d %s: %d %d\n", stat ? stat->lineNumber() : 0, ATTR_NODE(s_new) ? GRAPHNODE(s_new)->id : -1, s_new->identifier(), s_new->id(), s->id());
}