fixed routine convertation

This commit is contained in:
ALEXks
2025-01-12 15:58:18 +03:00
parent b0df33e926
commit 631a73ddc0
3 changed files with 19 additions and 5 deletions

View File

@@ -1476,7 +1476,7 @@ void convertExpr(SgExpression *expr, SgExpression* &retExp)
retExp->setLhs(expr->lhs());
retExp->setRhs(expr->rhs());
if (isUserFunction(tmpF->funName()) == 0)
if (isUserFunction(tmpF->funName()) == 0 && !inter)
{
printf(" [EXPR ERROR: %s, line %d, user line %d] unsupported variant of func call with name \"%s\"\n", __FILE__, __LINE__, first_do_par->lineNumber(), name);
if (unSupportedVars.size() != 0)
@@ -3302,6 +3302,19 @@ SgStatement* Translate_Fortran_To_C(SgStatement *Stmt, bool isSapforConv)
return converted.first;
}
void Translate_Fortran_To_C(SgStatement *firstStmt, SgStatement *lastStmt, int countOfCopy, SgStatement *st_header)
{ // entry for translating copy of the procedure called from Cuda-kernel
first_do_par = st_header;
SgStatement *save_st = cur_func;
cur_func = st_header;
std::vector < std::stack < SgStatement*> > zero = std::vector < std::stack < SgStatement*> >(0);
Translate_Fortran_To_C(firstStmt, lastStmt, zero, countOfCopy);
first_do_par = NULL;
cur_func = save_st;
return;
}
void Translate_Fortran_To_C(SgStatement *firstStmt, SgStatement *lastStmt, vector<stack<SgStatement*> > &copyBlock, int countOfCopy)
{

View File

@@ -379,10 +379,10 @@ SgStatement *InsertProcedureCopy(SgStatement *st_header, SgSymbol *sproc, int is
}
swapDimentionsInprivateList();
std::vector < std::stack < SgStatement*> > zero = std::vector < std::stack < SgStatement*> >(0);
cur_func = after;
Translate_Fortran_To_C(new_header, end_st, zero, 0); //TranslateProcedure_Fortran_To_C(after->lexNext());
//std::vector < std::stack < SgStatement*> > zero = std::vector < std::stack < SgStatement*> >(0);
//cur_func = after;
Translate_Fortran_To_C(new_header, end_st, 0, st_header); //TranslateProcedure_Fortran_To_C(after->lexNext());
cur_func = after;
if (sproc->variant() == FUNCTION_NAME)
{
new_header->insertStmtAfter(*Declaration_Statement(new_sproc), *new_header);

View File

@@ -2113,6 +2113,7 @@ char *Check_Correct_Name(const char *name);
char *Check_Correct_Name(const char *name);
/* acc_f2c.cpp */
void Translate_Fortran_To_C(SgStatement *stat, SgStatement *last, std::vector <std::stack <SgStatement*> > &, int);
void Translate_Fortran_To_C(SgStatement *stat, SgStatement *last, int countOfCopy, SgStatement *st_header);
SgStatement* Translate_Fortran_To_C(SgStatement* Stmt, bool isSapforConv = false);
SgSymbol* createNewFunctionSymbol(const char *name);