replace_io_arrays #67
@@ -17,6 +17,14 @@ using std::pair;
|
||||
|
||||
#define DEBUG_TRACE 0
|
||||
|
||||
static bool hasArrayRef(SgExpression* ex)
|
||||
{
|
||||
if (ex)
|
||||
return isArrayRef(ex) || hasArrayRef(ex->lhs()) || hasArrayRef(ex->rhs());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool isArrayDeclaration(SgStatement* st)
|
||||
{
|
||||
return isSgDeclarationStatement(st) || isSgVarListDeclStmt(st) || isSgNestedVarListDeclStmt(st);
|
||||
@@ -201,11 +209,15 @@ static bool populateDistributedIoArrays(map<SgSymbol*, set<SgStatement*>>& array
|
||||
if (!arg)
|
||||
return false;
|
||||
|
||||
if (!isArrayRef(arg))
|
||||
if (hasArrayRef(arg))
|
||||
{
|
||||
if (isArrayRef(arg) && arg->lhs())
|
||||
need_replace = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
||||
if (arg->lhs())
|
||||
need_replace = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user