added REMOVE_SPF pass

This commit is contained in:
ALEXks
2025-03-18 09:37:20 +03:00
parent 43dfc2368a
commit d58227bd0c
10 changed files with 63 additions and 93 deletions

View File

@@ -442,8 +442,11 @@ static void replaceComment(string &dir, const char *firstChar)
} }
} }
void removeDvmDirectives(SgFile *file, const bool toComment) void removeDvmSpfDirectives(SgFile* file, bool removeDvm, bool removeSpf, bool toComment)
{ {
if (!removeDvm && !removeSpf)
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
vector<SgStatement*> toDel; vector<SgStatement*> toDel;
vector<SgStatement*> toTotalDel; vector<SgStatement*> toTotalDel;
const string currFile = file->filename(); const string currFile = file->filename();
@@ -467,7 +470,7 @@ void removeDvmDirectives(SgFile *file, const bool toComment)
break; break;
const int var = st->variant(); const int var = st->variant();
if (isDVM_stat(st)) if (isDVM_stat(st) && removeDvm || isSPF_stat(st) && removeSpf)
if (st->fileName() == currFile) if (st->fileName() == currFile)
toDel.push_back(st); toDel.push_back(st);
@@ -477,7 +480,7 @@ void removeDvmDirectives(SgFile *file, const bool toComment)
} }
} }
if (toComment) if (toComment && removeDvm)
{ {
for (auto &elem : toDel) for (auto &elem : toDel)
{ {

View File

@@ -38,7 +38,7 @@ void insertShadowSpecToFile(SgFile* file, const char* fin_name, const std::set<s
const std::map<std::tuple<int, std::string, std::string>, std::pair<DIST::Array*, DIST::ArrayAccessInfo*>>& declaredArrays); const std::map<std::tuple<int, std::string, std::string>, std::pair<DIST::Array*, DIST::ArrayAccessInfo*>>& declaredArrays);
void insertDistributionToFile(const char* origFile, const char* outFile, const std::map<int, std::set<std::string>>& commentsToInclude); void insertDistributionToFile(const char* origFile, const char* outFile, const std::map<int, std::set<std::string>>& commentsToInclude);
void removeDvmDirectives(SgFile* file, const bool toComment); void removeDvmSpfDirectives(SgFile* file, bool removeDvm, bool removeSpf, bool toComment);
void insertDistributeDirsToParallelRegions(const std::vector<ParallelRegionLines>* currLines, void insertDistributeDirsToParallelRegions(const std::vector<ParallelRegionLines>* currLines,
const std::vector<Statement*>& reDistrRulesBefore, const std::vector<Statement*>& reDistrRulesBefore,

View File

@@ -343,11 +343,13 @@ static string unparseProjectIfNeed(SgFile* file, const int curr_regime, const bo
// copy includes that have not changed // copy includes that have not changed
if (folderName != NULL) if (folderName != NULL)
{ {
int removeDvmDirs = 0; int removeSpfDirs = 0;
if (curr_regime == REMOVE_DVM_DIRS) if (curr_regime == REMOVE_DVM_DIRS)
removeDvmDirs = 1; removeSpfDirs = 1;
else if (curr_regime == REMOVE_DVM_DIRS_TO_COMMENTS) else if (curr_regime == REMOVE_DVM_DIRS_TO_COMMENTS)
removeDvmDirs = 2; removeSpfDirs = 2;
else if (curr_regime == REMOVE_SPF_DIRS)
removeSpfDirs = 3;
set<string> allIncludeFilesFiltr; set<string> allIncludeFilesFiltr;
@@ -362,7 +364,7 @@ static string unparseProjectIfNeed(SgFile* file, const int curr_regime, const bo
} }
allIncludeFiles = allIncludeFilesFiltr; allIncludeFiles = allIncludeFilesFiltr;
copyIncludes(allIncludeFiles, commentsToInclude, newCopyDeclToIncl, folderName, keepSpfDirs, out_free_form == 1, (curr_regime == RENAME_INLCUDES), removeDvmDirs); copyIncludes(allIncludeFiles, commentsToInclude, newCopyDeclToIncl, folderName, keepSpfDirs, out_free_form == 1, (curr_regime == RENAME_INLCUDES), removeSpfDirs);
} }
} }
@@ -741,8 +743,12 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
} }
else if (curr_regime == LOOP_DATA_DEPENDENCIES) else if (curr_regime == LOOP_DATA_DEPENDENCIES)
doDependenceAnalysisOnTheFullFile(file, 1, 1, 1); doDependenceAnalysisOnTheFullFile(file, 1, 1, 1);
else if (curr_regime == REMOVE_DVM_DIRS || curr_regime == REMOVE_DVM_DIRS_TO_COMMENTS) else if (curr_regime == REMOVE_DVM_DIRS || curr_regime == REMOVE_DVM_DIRS_TO_COMMENTS || curr_regime == REMOVE_SPF_DIRS) {
removeDvmDirectives(file, curr_regime == REMOVE_DVM_DIRS_TO_COMMENTS); bool removeDvm = (curr_regime == REMOVE_DVM_DIRS || curr_regime == REMOVE_DVM_DIRS);
bool removeSpf = (curr_regime == REMOVE_SPF_DIRS);
bool toComment = (curr_regime == REMOVE_DVM_DIRS_TO_COMMENTS);
removeDvmSpfDirectives(file, removeDvm, removeSpf, toComment);
}
else if (curr_regime == REMOVE_DVM_INTERVALS) else if (curr_regime == REMOVE_DVM_INTERVALS)
{ {
vector<SgStatement*> toDel; vector<SgStatement*> toDel;
@@ -2309,6 +2315,7 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam
case INSERT_INCLUDES: case INSERT_INCLUDES:
case REMOVE_DVM_DIRS: case REMOVE_DVM_DIRS:
case REMOVE_DVM_DIRS_TO_COMMENTS: case REMOVE_DVM_DIRS_TO_COMMENTS:
case REMOVE_SPF_DIRS:
case PRIVATE_ARRAYS_EXPANSION: case PRIVATE_ARRAYS_EXPANSION:
case PRIVATE_ARRAYS_SHRINKING: case PRIVATE_ARRAYS_SHRINKING:
case UNROLL_LOOPS: case UNROLL_LOOPS:

View File

@@ -84,6 +84,7 @@ enum passes {
INSERT_INCLUDES, INSERT_INCLUDES,
REMOVE_DVM_DIRS, REMOVE_DVM_DIRS,
REMOVE_DVM_DIRS_TO_COMMENTS, REMOVE_DVM_DIRS_TO_COMMENTS,
REMOVE_SPF_DIRS,
REMOVE_DVM_INTERVALS, REMOVE_DVM_INTERVALS,
VERIFY_DVM_DIRS, VERIFY_DVM_DIRS,
@@ -262,6 +263,8 @@ static void setPassValues()
passNames[INSERT_INCLUDES] = "INSERT_INCLUDES"; passNames[INSERT_INCLUDES] = "INSERT_INCLUDES";
passNames[REMOVE_DVM_DIRS] = "REMOVE_DVM_DIRS"; passNames[REMOVE_DVM_DIRS] = "REMOVE_DVM_DIRS";
passNames[VERIFY_DVM_DIRS] = "VERIFY_DVM_DIRS"; passNames[VERIFY_DVM_DIRS] = "VERIFY_DVM_DIRS";
passNames[REMOVE_DVM_DIRS_TO_COMMENTS] = "REMOVE_DVM_DIRS_TO_COMMENTS";
passNames[REMOVE_SPF_DIRS] = "REMOVE_SPF_DIRS";
passNames[REMOVE_DIST_ARRAYS_FROM_IO] = "REMOVE_DIST_ARRAYS_FROM_IO"; passNames[REMOVE_DIST_ARRAYS_FROM_IO] = "REMOVE_DIST_ARRAYS_FROM_IO";
passNames[SUBST_EXPR] = "SUBST_EXPR"; passNames[SUBST_EXPR] = "SUBST_EXPR";
passNames[SUBST_EXPR_RD] = "SUBST_EXPR_RD"; passNames[SUBST_EXPR_RD] = "SUBST_EXPR_RD";
@@ -294,8 +297,7 @@ static void setPassValues()
passNames[PREDICT_SCHEME] = "PREDICT_SCHEME"; passNames[PREDICT_SCHEME] = "PREDICT_SCHEME";
passNames[GET_STATS_FOR_PREDICTOR] = "GET_STATS_FOR_PREDICTOR"; passNames[GET_STATS_FOR_PREDICTOR] = "GET_STATS_FOR_PREDICTOR";
passNames[DEF_USE_STAGE1] = "DEF_USE_STAGE1"; passNames[DEF_USE_STAGE1] = "DEF_USE_STAGE1";
passNames[DEF_USE_STAGE2] = "DEF_USE_STAGE2"; passNames[DEF_USE_STAGE2] = "DEF_USE_STAGE2";
passNames[REMOVE_DVM_DIRS_TO_COMMENTS] = "REMOVE_DVM_DIRS_TO_COMMENTS";
passNames[REVERT_SPF_DIRS] = "REVERT_SPF_DIRS"; passNames[REVERT_SPF_DIRS] = "REVERT_SPF_DIRS";
passNames[CLEAR_SPF_DIRS] = "CLEAR_SPF_DIRS"; passNames[CLEAR_SPF_DIRS] = "CLEAR_SPF_DIRS";
passNames[INSERT_REGIONS] = "INSERT_REGIONS"; passNames[INSERT_REGIONS] = "INSERT_REGIONS";

View File

@@ -273,11 +273,11 @@ void InitPassesDependencies(map<passes, vector<passes>> &passDepsIn, set<passes>
Pass(REVERT_SUBST_EXPR_RD) <= list({ PURE_SAVE_TO_PARAMS, PURE_MODULE_TO_PARAMS, PURE_COMMON_TO_PARAMS, PURE_INTENT_INSERT }); Pass(REVERT_SUBST_EXPR_RD) <= list({ PURE_SAVE_TO_PARAMS, PURE_MODULE_TO_PARAMS, PURE_COMMON_TO_PARAMS, PURE_INTENT_INSERT });
list({ CORRECT_VAR_DECL, REVERT_SUBST_EXPR_RD, VERIFY_INCLUDES }) <= list({ CONVERT_TO_ENDDO, CORRECT_CODE_STYLE, REMOVE_DVM_DIRS, REMOVE_DVM_DIRS_TO_COMMENTS, REMOVE_DVM_INTERVALS }); list({ CORRECT_VAR_DECL, REVERT_SUBST_EXPR_RD, VERIFY_INCLUDES }) <= list({ CONVERT_TO_ENDDO, CORRECT_CODE_STYLE, REMOVE_DVM_DIRS, REMOVE_DVM_DIRS_TO_COMMENTS, REMOVE_SPF_DIRS, REMOVE_DVM_INTERVALS });
list({ CALL_GRAPH2, CONVERT_LOOP_TO_ASSIGN, REVERT_SUBST_EXPR_RD, RESTORE_LOOP_FROM_ASSIGN }) <= Pass(INLINE_PROCEDURES); list({ CALL_GRAPH2, CONVERT_LOOP_TO_ASSIGN, REVERT_SUBST_EXPR_RD, RESTORE_LOOP_FROM_ASSIGN }) <= Pass(INLINE_PROCEDURES);
list({ CONVERT_LOOP_TO_ASSIGN, CORRECT_FORMAT_PLACE }) <= list({ CONVERT_TO_ENDDO, CORRECT_CODE_STYLE, INSERT_INCLUDES, REMOVE_DVM_DIRS, REMOVE_DVM_DIRS_TO_COMMENTS, REMOVE_DVM_INTERVALS }); list({ CONVERT_LOOP_TO_ASSIGN, CORRECT_FORMAT_PLACE }) <= list({ CONVERT_TO_ENDDO, CORRECT_CODE_STYLE, INSERT_INCLUDES, REMOVE_DVM_DIRS, REMOVE_DVM_DIRS_TO_COMMENTS, REMOVE_SPF_DIRS, REMOVE_DVM_INTERVALS });
list({ CORRECT_VAR_DECL, REVERT_SUBST_EXPR_RD }) <= list({ INSERT_INCLUDES, UNPARSE_FILE, SET_TO_ALL_DECL_INIT_ZERO }); list({ CORRECT_VAR_DECL, REVERT_SUBST_EXPR_RD }) <= list({ INSERT_INCLUDES, UNPARSE_FILE, SET_TO_ALL_DECL_INIT_ZERO });

View File

@@ -556,7 +556,7 @@ string renameInclude(const string& inc)
void copyIncludes(const set<string> &allIncludeFiles, const map<string, map<int, set<string>>> &commentsToInclude, void copyIncludes(const set<string> &allIncludeFiles, const map<string, map<int, set<string>>> &commentsToInclude,
const map<string, map<int, set<string>>>& newCopyDeclToIncl, const map<string, map<int, set<string>>>& newCopyDeclToIncl,
const char *folderName, bool keepSpfDirs, bool isFreeStyle, bool isRename, const char *folderName, bool keepSpfDirs, bool isFreeStyle, bool isRename,
int removeDvmDirs) int removeDirs)
{ {
for (auto &include : allIncludeFiles) for (auto &include : allIncludeFiles)
{ {
@@ -601,18 +601,24 @@ void copyIncludes(const set<string> &allIncludeFiles, const map<string, map<int,
bufStr = "\n"; bufStr = "\n";
} }
//remove DVM dirs or save DVM dirs as comment //remove DVM dirs or save DVM dirs as comment
if (removeDvmDirs == 1 || removeDvmDirs == 2) if (removeDirs == 1 || removeDirs == 2)
{ {
if (bufStr[0] == '!' || bufStr[0] == 'c') if (bufStr[0] == '!' || bufStr[0] == 'c')
{ {
if (bufStr[1] == 'd' && bufStr[2] == 'v' && bufStr[3] == 'm' && bufStr[4] == '$') if (bufStr[1] == 'd' && bufStr[2] == 'v' && bufStr[3] == 'm' && bufStr[4] == '$')
{ {
if (removeDvmDirs == 1) if (removeDirs == 1)
bufStr = ""; bufStr = "";
else if (removeDvmDirs == 2) else if (removeDirs == 2)
bufStr.insert(1, " "); bufStr.insert(1, " ");
} }
} }
} //remove SPF dirs
else if (removeDirs == 3)
{
if (bufStr[0] == '!' || bufStr[0] == 'c')
if (bufStr[1] == '$' && bufStr[2] == 's' && bufStr[3] == 'p' && bufStr[4] == 'f')
bufStr = "";
} }
// save original include name // save original include name

View File

@@ -34,7 +34,7 @@ std::wstring to_wstring(const std::string);
void convertBuffers(short*& resultM, int*& resultSizeM, short*& result, int*& resultSize); void convertBuffers(short*& resultM, int*& resultSizeM, short*& result, int*& resultSize);
void clearGlobalMessagesBuffer(); void clearGlobalMessagesBuffer();
std::string renameInclude(const std::string& inc); std::string renameInclude(const std::string& inc);
void copyIncludes(const std::set<std::string> &allIncludeFiles, const std::map<std::string, std::map<int, std::set<std::string>>> &commentsToInclude, const std::map<std::string, std::map<int, std::set<std::string>>>& newCopyDeclToIncl, const char *folderName, bool keepSpfDirs, bool isFreeStyle, bool isRename, int removeDvmDirs = 0); void copyIncludes(const std::set<std::string> &allIncludeFiles, const std::map<std::string, std::map<int, std::set<std::string>>> &commentsToInclude, const std::map<std::string, std::map<int, std::set<std::string>>>& newCopyDeclToIncl, const char *folderName, bool keepSpfDirs, bool isFreeStyle, bool isRename, int removeDirs = 0);
std::string splitDirective(const std::string &in); std::string splitDirective(const std::string &in);
std::string splitDirectiveFull(const std::string &in_); std::string splitDirectiveFull(const std::string &in_);

View File

@@ -1,3 +1,3 @@
#pragma once #pragma once
#define VERSION_SPF "2397" #define VERSION_SPF "2398"

View File

@@ -1820,6 +1820,14 @@ int SPF_RemoveDvmDirectives(void*& context, int winHandler, short *options, shor
return simpleTransformPass(REMOVE_DVM_DIRS, options, projName, folderName, output, outputSize, outputMessage, outputMessageSize); return simpleTransformPass(REMOVE_DVM_DIRS, options, projName, folderName, output, outputSize, outputMessage, outputMessageSize);
} }
int SPF_RemoveSpfDirectives(void*& context, int winHandler, short* options, short* projName, short* folderName, short*& output,
int*& outputSize, short*& outputMessage, int*& outputMessageSize)
{
MessageManager::clearCache();
MessageManager::setWinHandler(winHandler);
return simpleTransformPass(REMOVE_SPF_DIRS, options, projName, folderName, output, outputSize, outputMessage, outputMessageSize);
}
int SPF_RemoveDvmDirectivesToComments(void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int SPF_RemoveDvmDirectivesToComments(void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output,
int *&outputSize, short *&outputMessage, int *&outputMessageSize) int *&outputSize, short *&outputMessage, int *&outputMessageSize)
{ {
@@ -2591,6 +2599,8 @@ const wstring Sapfor_RunTransformation(const char* transformName_c, const char*
retCode = SPF_RemoveOmpDirectives(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize); retCode = SPF_RemoveOmpDirectives(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize);
else if (whichRun == "SPF_RemoveDvmDirectives") else if (whichRun == "SPF_RemoveDvmDirectives")
retCode = SPF_RemoveDvmDirectives(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize); retCode = SPF_RemoveDvmDirectives(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize);
else if (whichRun == "SPF_RemoveSpfDirectives")
retCode = SPF_RemoveSpfDirectives(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize);
else if (whichRun == "SPF_RemoveDvmDirectivesToComments") else if (whichRun == "SPF_RemoveDvmDirectivesToComments")
retCode = SPF_RemoveDvmDirectivesToComments(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize); retCode = SPF_RemoveDvmDirectivesToComments(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize);
else if (whichRun == "SPF_RemoveComments") else if (whichRun == "SPF_RemoveComments")
@@ -2603,21 +2613,6 @@ const wstring Sapfor_RunTransformation(const char* transformName_c, const char*
retCode = SPF_RemoveDistArraysFromIO(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize); retCode = SPF_RemoveDistArraysFromIO(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize);
else if (whichRun == "SPF_LoopEndDoConverterPass") else if (whichRun == "SPF_LoopEndDoConverterPass")
retCode = SPF_LoopEndDoConverterPass(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize); retCode = SPF_LoopEndDoConverterPass(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize);
else if (whichRun == "SPF_CreateParallelVariant")
{
vector<string> splited;
string orig(addOpt_c);
splitString(orig, '|', splited);
int64_t* variants = NULL;
int varLen = -1;
fillInfo(splited, variants, varLen);
retCode = SPF_CreateParallelVariant(context, winHandler, optSh, projSh, fold, variants, &varLen, output, outputSize, outputMessage, outputMessageSize, predStats);
if (retCode > 0)
delete[]variants;
}
else if (whichRun == "SPF_LoopFission") else if (whichRun == "SPF_LoopFission")
retCode = SPF_LoopFission(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize); retCode = SPF_LoopFission(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize);
else if (whichRun == "SPF_LoopUnion") else if (whichRun == "SPF_LoopUnion")
@@ -2664,6 +2659,21 @@ const wstring Sapfor_RunTransformation(const char* transformName_c, const char*
retCode = SPF_InsertImplicitNone(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize); retCode = SPF_InsertImplicitNone(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize);
else if (whichRun == "SPF_RenameIncludes") else if (whichRun == "SPF_RenameIncludes")
retCode = SPF_RenameIncludes(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize); retCode = SPF_RenameIncludes(context, winHandler, optSh, projSh, fold, output, outputSize, outputMessage, outputMessageSize);
else if (whichRun == "SPF_CreateParallelVariant")
{
vector<string> splited;
string orig(addOpt_c);
splitString(orig, '|', splited);
int64_t* variants = NULL;
int varLen = -1;
fillInfo(splited, variants, varLen);
retCode = SPF_CreateParallelVariant(context, winHandler, optSh, projSh, fold, variants, &varLen, output, outputSize, outputMessage, outputMessageSize, predStats);
if (retCode > 0)
delete[]variants;
}
else else
{ {
if (showDebug) if (showDebug)

View File

@@ -1,53 +1,5 @@
#pragma once #pragma once
#if _WIN32
// ANALISYS
extern "C" { __declspec(dllexport) int SPF_GetGraphLoops(void*& context, int winHandler, short *options, short *projName, short *&result, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_GetGraphFunctions(void*& context, int winHandler, short *options, short *projName, short *&result, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_GetGraphVizOfFunctions(void*& context, short *options, short *projName, short *&result, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_GetArrayDistribution(void*& context, int winHandler, short *options, short *projName, short *&result, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize, int onlyAnalysis); }
extern "C" { __declspec(dllexport) int SPF_SetFunctionsToInclude(void*& context, int winHandler, short *options, short *projName, short *&result, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_GetAllDeclaratedArrays(void*& context, int winHandler, short *options, short *projName, short *&result, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_GetFileLineInfo(void*& context, int winHandler, short *options, short *projName, short *&result, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_GetIncludeDependencies(void*& context, int winHandler, short *options, short *projName, short *&resultt, short*& output, int*& outputSize, short*& outputMessage, int*& outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_GetGCovInfo(void*& context, int winHandler, short *options, short *projName, short *&result, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_ParseFiles(void*& context, int winHandler, short *options, short* projName, short*& output, int*& outputSize, short*& outputMessage, int*& outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_StatisticAnalyzer(void*& context, int winHandler, short* options, short* pppaOptions, short*& output, int*& outputSize, short*& outputMessage, int*& outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_GetPassesState(void*& context, int *&passInfo); } // deprecated
extern "C" { __declspec(dllexport) int SPF_GetPassesStateStr(void*& context, short *&passInfo); }
extern "C" { __declspec(dllexport) int SPF_GetVersionAndBuildDate(void*& context, short *&result); }
extern "C" { __declspec(dllexport) int SPF_GetIntrinsics(void*& context, short *&result); }
extern "C" { __declspec(dllexport) void SPF_deleteAllAllocatedData(void*& context); }
// CODE TRANSFORMATION
extern "C" { __declspec(dllexport) int SPF_CorrectCodeStylePass (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_RemoveDvmDirectives (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_RemoveDvmDirectivesToComments (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_InsertIncludesPass (void*& context, int winHandler, short *options, short *projName, short *folderName, char *filesToInclude, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_ResolveParallelRegionConflicts(void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_LoopEndDoConverterPass (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_CreateParallelVariant (void*& context, int winHandler, short *options, short *projName, short *folderName, int64_t *variants, int *varLen, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize, short *&predictorStats); }
extern "C" { __declspec(dllexport) int SPF_LoopFission (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_LoopUnion (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_PrivateExpansion (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_PrivateShrinking (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_PrivateRemoving (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_CreateIntervalsTree (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_RemoveDvmIntervals (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_DuplicateFunctionChains (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int *&outputSize, short *&outputMessage, int *&outputMessageSize); }
extern "C" { __declspec(dllexport) int SPF_InlineProcedures (void*& context, int winHandler, short *options, short *projName, short *folderName, short *names, short *&output, int*& outputSize, short*& outputMessage, int*& outputMessageSize, int type); }
int SPF_CreateCheckpoints (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int*& outputSize, short*& outputMessage, int*& outputMessageSize);
int SPF_InitDeclsWithZero (void*& context, int winHandler, short *options, short *projName, short *folderName, short *&output, int*& outputSize, short*& outputMessage, int*& outputMessageSize);
//CODE MODIFICATION
extern "C" { __declspec(dllexport) int SPF_ModifyArrayDistribution (void*& context, int winHandler, short *options, short* projName, short*& output, int*& outputSize, short*& outputMessage, int*& outputMessageSize, int regId, int64_t* toModify); }
extern "C" { __declspec(dllexport) int SPF_InlineProcedure (void*& context, int winHandler, short* options, short* projName, short* folderName, short* name, short* file, int line, short*& output, int*& outputSize, short*& outputMessage, int*& outputMessageSize, int& size, int*& sizes, short*& newFilesNames, short*& newFiles); }
extern "C" { __declspec(dllexport) int SPF_LoopUnionCurrent (void*& context, int winHandler, short* options, short* projName, short* folderName, short* file, int line, short*& output, int*& outputSize, short*& outputMessage, int*& outputMessageSize, int& size, int*& sizes, short*& newFilesNames, short*& newFiles); }
extern "C" { __declspec(dllexport) int SPF_ChangeSpfIntervals (void*& context, int winHandler, short* options, short* projName, short* folderName, short*& output, int*& outputSize, short*& outputMessage, int*& outputMessageSize, short* fileNameToMod, int* toModifyLines, int& size, int*& sizes, short*& newFilesNames, short*& newFiles); }
extern "C" { __declspec(dllexport) int SPF_SetDistributionFlagToArray (void*& context, char* key, int flag); }
extern "C" { __declspec(dllexport) int SPF_SetDistributionFlagToArrays(void*& context, const char* keys, const char* flags); }
#endif
void createNeededException(); void createNeededException();
void RunSapforAsClient(int); void RunSapforAsClient(int);
@@ -55,13 +7,3 @@ const std::wstring Sapfor_RunAnalysis(const char* name, const char* options_c, c
const std::wstring Sapfor_RunTransformation(const char* name, const char* options_c, const char* projName_c, const char* folder_c, const char* addOpt_c, int winHandler); const std::wstring Sapfor_RunTransformation(const char* name, const char* options_c, const char* projName_c, const char* folder_c, const char* addOpt_c, int winHandler);
const std::wstring Sapfor_RunModification(const char* name, const char* options_c, const char* projName_c, const char* folder_c, const char* addOpt1_c, const char* addOpt2_c, int winHandler); const std::wstring Sapfor_RunModification(const char* name, const char* options_c, const char* projName_c, const char* folder_c, const char* addOpt1_c, const char* addOpt2_c, int winHandler);
void sendErrorCode(const std::wstring& message); void sendErrorCode(const std::wstring& message);
#ifdef JAVA
#include <jni.h>
extern "C"
{
JNIEXPORT jcharArray JNICALL Java_components_Sapfor_SPF_1RunAnalysis (JNIEnv*, jobject, jstring, jint, jstring, jstring);
JNIEXPORT jcharArray JNICALL Java_components_Sapfor_SPF_1RunTransformation(JNIEnv*, jobject, jstring, jint, jstring, jstring, jstring, jstring);
JNIEXPORT jcharArray JNICALL Java_components_Sapfor_SPF_1RunModification (JNIEnv*, jobject, jstring, jint, jstring, jstring, jstring, jstring, jstring);
}
#endif