fixed inout analysis for function's parameters
This commit is contained in:
@@ -779,6 +779,20 @@ static void checkSpecList(SgExpression *spec, FuncInfo* currF, const map<string,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void checkInTypeDescription(SgExpression *ex, FuncInfo* currF, const map<string, int>& parNames)
|
||||||
|
{
|
||||||
|
if (ex)
|
||||||
|
{
|
||||||
|
if (ex->variant() == ARRAY_REF)
|
||||||
|
fillIn(currF, ex->lhs(), parNames, false);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
checkInTypeDescription(ex->lhs(), currF, parNames);
|
||||||
|
checkInTypeDescription(ex->rhs(), currF, parNames);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void fillInOut(FuncInfo *currF, SgStatement *start, SgStatement *last, const set<SgStatement*>& activeOps)
|
static void fillInOut(FuncInfo *currF, SgStatement *start, SgStatement *last, const set<SgStatement*>& activeOps)
|
||||||
{
|
{
|
||||||
if (currF->funcParams.countOfPars == 0)
|
if (currF->funcParams.countOfPars == 0)
|
||||||
@@ -799,7 +813,12 @@ static void fillInOut(FuncInfo *currF, SgStatement *start, SgStatement *last, co
|
|||||||
if (st->variant() == ENTRY_STAT)
|
if (st->variant() == ENTRY_STAT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (isSgExecutableStatement(st) == NULL || st->lineNumber() <= 0)
|
if (isSgExecutableStatement(st) == NULL) {
|
||||||
|
checkInTypeDescription(st->expr(0), currF, parNames);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (st->lineNumber() <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (activeOps.size() && activeOps.find(st) == activeOps.end())
|
if (activeOps.size() && activeOps.find(st) == activeOps.end())
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2434"
|
#define VERSION_SPF "2435"
|
||||||
|
|||||||
Reference in New Issue
Block a user