1 Commits

Author SHA1 Message Date
ALEXks
84c8394ae7 fixed function names 2024-03-23 11:17:16 +03:00

View File

@@ -9,6 +9,7 @@
using std::vector;
using std::map;
using std::set;
using std::string;
static const char commonIntLetters[6] = { 'i', 'j', 'k', 'm', 'n', 'l' };
@@ -131,6 +132,9 @@ static map<char, SgType*> FunctionImplicitCheck(SgStatement* function, const map
for (auto& var : allVars)
{
if (string(var->identifier()) == function->symbol()->identifier())
continue;
vector<SgStatement*> _;
SgStatement* declaredInStatement = declaratedInStmt(var, &_, false);
if (declaredInStatement == NULL)
@@ -162,7 +166,11 @@ static map<char, SgType*> FunctionImplicitCheck(SgStatement* function, const map
st = st->lexNext();
}
function->insertStmtAfter(*new SgStatement(IMPL_DECL), *function);
auto implNone = new SgStatement(IMPL_DECL);
implNone->setlineNumber(function->lineNumber());
implNone->setFileName(function->fileName());
function->insertStmtAfter(*implNone, *function);
}
allVars.clear();
@@ -173,6 +181,10 @@ static map<char, SgType*> FunctionImplicitCheck(SgStatement* function, const map
void ImplicitCheck(SgFile* file)
{
if (file->filename() == std::string("add.f"))
{
file->unparsestdout();
}
map<SgStatement*, map<char, SgType*>> typesByFunctions;
for (int func = 0; func < file->numberOfFunctions(); ++func)
@@ -182,4 +194,9 @@ void ImplicitCheck(SgFile* file)
}
typesByFunctions.clear();
if (file->filename() == std::string("add.f"))
{
file->unparsestdout();
}
}