3 Commits

Author SHA1 Message Date
ALEXks
7badbdb626 fixed removeDvmSpfDirectives
(cherry picked from commit 381e3c5355)
2025-03-29 18:10:30 +03:00
ALEXks
3571f97221 fixed removeDvmSpfDirectives
(cherry picked from commit 7eef52eb90)
2025-03-29 18:10:27 +03:00
ALEXks
d71e8c5d66 fixed module analysis
(cherry picked from commit 6235d11eb7)
2025-03-29 18:10:09 +03:00
3 changed files with 7 additions and 7 deletions

View File

@@ -442,9 +442,9 @@ static void replaceComment(string &dir, const char *firstChar)
}
}
void removeDvmSpfDirectives(SgFile* file, bool removeDvm, bool removeSpf, bool toComment)
void removeDvmSpfDirectives(SgFile* file, bool removeDvm, bool removeSpf, bool toCommentDvm)
{
if (!removeDvm && !removeSpf)
if (!removeDvm && !removeSpf && !toCommentDvm)
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
vector<SgStatement*> toDel;
@@ -470,7 +470,7 @@ void removeDvmSpfDirectives(SgFile* file, bool removeDvm, bool removeSpf, bool t
break;
const int var = st->variant();
if (isDVM_stat(st) && removeDvm || isSPF_stat(st) && removeSpf)
if (isDVM_stat(st) && (removeDvm || toCommentDvm) || isSPF_stat(st) && removeSpf)
if (st->fileName() == currFile)
toDel.push_back(st);
@@ -480,7 +480,7 @@ void removeDvmSpfDirectives(SgFile* file, bool removeDvm, bool removeSpf, bool t
}
}
if (toComment && removeDvm)
if (toCommentDvm)
{
for (auto &elem : toDel)
{
@@ -500,7 +500,7 @@ void removeDvmSpfDirectives(SgFile* file, bool removeDvm, bool removeSpf, bool t
elem->deleteStmt();
}
}
else
else //removeSpf or removeDvm
{
for (auto &elem : toDel)
{

View File

@@ -310,7 +310,7 @@ static void getModuleSymbols(SgStatement* func, set<SgSymbol*>& symbs)
SgSymbol* s = func->symbol()->next();
while (s)
{
if (IS_BY_USE(s) && s->scope()->symbol()->identifier() == currScope)
if (IS_BY_USE(s) && s->scope() && s->scope()->symbol()->identifier() == currScope)
symbs.insert(s);
s = s->next();
}

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2399"
#define VERSION_SPF "2401"