fixed transformation

This commit is contained in:
ALEXks
2025-07-27 07:59:25 +03:00
parent d3d6d0bec7
commit 0c9eed4bb7
2 changed files with 9 additions and 17 deletions

View File

@@ -289,23 +289,10 @@ void transformAssumedSizeParameters(const map<string, vector<FuncInfo*>>& allFun
SgProcHedrStmt* proc = isSgProcHedrStmt(func->funcPointer->GetOriginal());
checkNull(proc, convertFileName(__FILE__).c_str(), __LINE__);
makeDeclaration(parNames, scope);
//makeDeclaration(parNames, scope);
for (auto& newPar : parNames)
{
auto arg = new SgVarRefExp(newPar);
BIF_LL1(proc->thebif) = addToExprList(BIF_LL1(proc->thebif), arg->thellnd);
PTR_LLND ll;
PTR_SYMB symb;
ll = giveLlSymbInDeclList(arg->thellnd);
if (ll && (symb = NODE_SYMB(ll)))
{
appendSymbToArgList(BIF_SYMB(proc->thebif), symb);
SYMB_SCOPE(symb) = proc->thebif;
}
//proc->AddArg(*new SgVarRefExp(newPar));
}
proc->AddArg(*new SgVarRefExp(newPar));
}
}
}
@@ -360,7 +347,12 @@ void transformAssumedSizeParameters(const map<string, vector<FuncInfo*>>& allFun
if (parNum >= pars.size())
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
SgFunctionCallExp* call = new SgFunctionCallExp(*funcSize, *pars[parNum]);
//TODO: need to do it better
SgExpression* parArray = pars[parNum]->copyPtr();
parArray->setLhs(NULL);
parArray->setRhs(NULL);
SgFunctionCallExp* call = new SgFunctionCallExp(*funcSize, *parArray);
last->setRhs(new SgExpression(EXPR_LIST, call));
last = last->rhs();

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2437"
#define VERSION_SPF "2439"