diff --git a/sapfor/experts/Sapfor_2017/CMakeLists.txt b/sapfor/experts/Sapfor_2017/CMakeLists.txt index 82e446e..224909a 100644 --- a/sapfor/experts/Sapfor_2017/CMakeLists.txt +++ b/sapfor/experts/Sapfor_2017/CMakeLists.txt @@ -55,47 +55,47 @@ include_directories(${zlib_sources}/include) include_directories(${pppa_sources}) set(PR_PARAM _src/ProjectParameters/projectParameters.cpp - _src/ProjectParameters/projectParameters.h) + _src/ProjectParameters/projectParameters.h) set(GR_LAYOUT _src/VisualizerCalls/graphLayout/algebra.cpp - _src/VisualizerCalls/graphLayout/algebra.hpp - _src/VisualizerCalls/graphLayout/fruchterman_reingold.cpp - _src/VisualizerCalls/graphLayout/fruchterman_reingold.hpp - _src/VisualizerCalls/graphLayout/kamada_kawai.cpp - _src/VisualizerCalls/graphLayout/kamada_kawai.hpp - _src/VisualizerCalls/graphLayout/layout.cpp - _src/VisualizerCalls/graphLayout/layout.hpp - _src/VisualizerCalls/graphLayout/nodesoup.cpp - _src/VisualizerCalls/graphLayout/nodesoup.hpp) - + _src/VisualizerCalls/graphLayout/algebra.hpp + _src/VisualizerCalls/graphLayout/fruchterman_reingold.cpp + _src/VisualizerCalls/graphLayout/fruchterman_reingold.hpp + _src/VisualizerCalls/graphLayout/kamada_kawai.cpp + _src/VisualizerCalls/graphLayout/kamada_kawai.hpp + _src/VisualizerCalls/graphLayout/layout.cpp + _src/VisualizerCalls/graphLayout/layout.hpp + _src/VisualizerCalls/graphLayout/nodesoup.cpp + _src/VisualizerCalls/graphLayout/nodesoup.hpp) + set(VS_CALLS _src/VisualizerCalls/get_information.cpp - _src/VisualizerCalls/get_information.h - _src/VisualizerCalls/SendMessage.cpp - _src/VisualizerCalls/SendMessage.h - _src/VisualizerCalls/BuildGraph.cpp - _src/VisualizerCalls/BuildGraph.h) - + _src/VisualizerCalls/get_information.h + _src/VisualizerCalls/SendMessage.cpp + _src/VisualizerCalls/SendMessage.h + _src/VisualizerCalls/BuildGraph.cpp + _src/VisualizerCalls/BuildGraph.h) + set(VERIF _src/VerificationCode/CorrectVarDecl.cpp _src/VerificationCode/IncludeChecker.cpp _src/VerificationCode/StructureChecker.cpp _src/VerificationCode/VerifySageStructures.cpp - _src/VerificationCode/verifications.h) + _src/VerificationCode/verifications.h) set(UTILS _src/Utils/AstWrapper.h - _src/Utils/BoostStackTrace.cpp - _src/Utils/CommonBlock.h - _src/Utils/DefUseList.h - _src/Utils/errors.h - _src/Utils/leak_detector.h - _src/Utils/RationalNum.cpp - _src/Utils/RationalNum.h + _src/Utils/BoostStackTrace.cpp + _src/Utils/CommonBlock.h + _src/Utils/DefUseList.h + _src/Utils/errors.h + _src/Utils/leak_detector.h + _src/Utils/RationalNum.cpp + _src/Utils/RationalNum.h _src/Utils/SgUtils.cpp - _src/Utils/SgUtils.h + _src/Utils/SgUtils.h _src/Utils/types.h _src/Utils/utils.cpp - _src/Utils/utils.h - _src/Utils/version.h) - + _src/Utils/utils.h + _src/Utils/version.h) + set(OMEGA _src/SageAnalysisTool/OmegaForSage/add-assert.cpp _src/SageAnalysisTool/OmegaForSage/affine.cpp _src/SageAnalysisTool/OmegaForSage/cover.cpp @@ -126,211 +126,211 @@ set(OMEGA _src/SageAnalysisTool/OmegaForSage/add-assert.cpp _src/SageAnalysisTool/set.cpp) set(PRIV _src/PrivateAnalyzer/private_analyzer.cpp - _src/PrivateAnalyzer/private_analyzer.h) + _src/PrivateAnalyzer/private_analyzer.h) set(FDVM ${fdvm_sources}/acc.cpp - ${fdvm_sources}/acc_across.cpp - ${fdvm_sources}/acc_across_analyzer.cpp - ${fdvm_sources}/acc_analyzer.cpp + ${fdvm_sources}/acc_across.cpp + ${fdvm_sources}/acc_across_analyzer.cpp + ${fdvm_sources}/acc_analyzer.cpp ${fdvm_sources}/acc_data.cpp - ${fdvm_sources}/acc_f2c.cpp - ${fdvm_sources}/acc_f2c_handlers.cpp - ${fdvm_sources}/acc_rtc.cpp - ${fdvm_sources}/acc_rtc.cpp + ${fdvm_sources}/acc_f2c.cpp + ${fdvm_sources}/acc_f2c_handlers.cpp + ${fdvm_sources}/acc_rtc.cpp + ${fdvm_sources}/acc_rtc.cpp ${fdvm_sources}/acc_utilities.cpp - ${fdvm_sources}/aks_analyzeLoops.cpp - ${fdvm_sources}/aks_structs.cpp - ${fdvm_sources}/checkpoint.cpp - ${fdvm_sources}/debug.cpp - ${fdvm_sources}/dvm.cpp + ${fdvm_sources}/aks_analyzeLoops.cpp + ${fdvm_sources}/aks_structs.cpp + ${fdvm_sources}/checkpoint.cpp + ${fdvm_sources}/debug.cpp + ${fdvm_sources}/dvm.cpp ${fdvm_sources}/calls.cpp - ${fdvm_sources}/funcall.cpp - ${fdvm_sources}/help.cpp - ${fdvm_sources}/hpf.cpp - ${fdvm_sources}/io.cpp - ${fdvm_sources}/omp.cpp - ${fdvm_sources}/ompdebug.cpp - ${fdvm_sources}/parloop.cpp - ${fdvm_sources}/stmt.cpp) - + ${fdvm_sources}/funcall.cpp + ${fdvm_sources}/help.cpp + ${fdvm_sources}/hpf.cpp + ${fdvm_sources}/io.cpp + ${fdvm_sources}/omp.cpp + ${fdvm_sources}/ompdebug.cpp + ${fdvm_sources}/parloop.cpp + ${fdvm_sources}/stmt.cpp) + set(PARALLEL_REG _src/ParallelizationRegions/ParRegions.cpp - _src/ParallelizationRegions/ParRegions.h - _src/ParallelizationRegions/ParRegions_func.h - _src/ParallelizationRegions/expand_extract_reg.cpp - _src/ParallelizationRegions/expand_extract_reg.h - _src/ParallelizationRegions/resolve_par_reg_conflicts.cpp - _src/ParallelizationRegions/resolve_par_reg_conflicts.h) + _src/ParallelizationRegions/ParRegions.h + _src/ParallelizationRegions/ParRegions_func.h + _src/ParallelizationRegions/expand_extract_reg.cpp + _src/ParallelizationRegions/expand_extract_reg.h + _src/ParallelizationRegions/resolve_par_reg_conflicts.cpp + _src/ParallelizationRegions/resolve_par_reg_conflicts.h) set(TR_DEAD_CODE _src/Transformations/dead_code.cpp - _src/Transformations/dead_code.h) + _src/Transformations/dead_code.h) set(TR_CP _src/Transformations/checkpoints.cpp - _src/Transformations/checkpoints.h) + _src/Transformations/checkpoints.h) set(TR_VECTOR _src/Transformations/array_assign_to_loop.cpp - _src/Transformations/array_assign_to_loop.h) + _src/Transformations/array_assign_to_loop.h) set(TR_ENDDO_LOOP _src/Transformations/enddo_loop_converter.cpp - _src/Transformations/enddo_loop_converter.h) + _src/Transformations/enddo_loop_converter.h) set(TR_LOOP_NEST _src/Transformations/loop_transform.cpp - _src/Transformations/loop_transform.h) + _src/Transformations/loop_transform.h) set(TR_LOOP_COMB _src/Transformations/loops_combiner.cpp - _src/Transformations/loops_combiner.h) + _src/Transformations/loops_combiner.h) set(TR_LOOP_SPLIT _src/Transformations/loops_splitter.cpp - _src/Transformations/loops_splitter.h) + _src/Transformations/loops_splitter.h) set(TR_LOOP_UNROLL _src/Transformations/loops_unrolling.cpp - _src/Transformations/loops_unrolling.h) + _src/Transformations/loops_unrolling.h) set(TR_PRIV_BR _src/Transformations/private_arrays_resizing.cpp - _src/Transformations/private_arrays_resizing.h) + _src/Transformations/private_arrays_resizing.h) set(TR_PRIV_DEL _src/Transformations/private_removing.cpp - _src/Transformations/private_removing.h) + _src/Transformations/private_removing.h) set(TR_SWAP_ARR_DIMS _src/Transformations/swap_array_dims.cpp - _src/Transformations/swap_array_dims.h) + _src/Transformations/swap_array_dims.h) set(TR_FUNC_DUP _src/Transformations/uniq_call_chain_dup.cpp - _src/Transformations/uniq_call_chain_dup.h) + _src/Transformations/uniq_call_chain_dup.h) set(TR_FUNC_PURE _src/Transformations/function_purifying.cpp - _src/Transformations/function_purifying.h) + _src/Transformations/function_purifying.h) set(TR_GV _src/Transformations/fix_common_blocks.cpp - _src/Transformations/fix_common_blocks.h) + _src/Transformations/fix_common_blocks.h) set(TR_CONV _src/Transformations/convert_to_c.cpp - _src/Transformations/convert_to_c.h) + _src/Transformations/convert_to_c.h) set(TR_IMPLICIT_NONE _src/Transformations/set_implicit_none.cpp - _src/Transformations/set_implicit_none.h) + _src/Transformations/set_implicit_none.h) set(TRANSFORMS - ${TR_DEAD_CODE} - ${TR_CP} - ${TR_VECTOR} - ${TR_ENDDO_LOOP} - ${TR_LOOP_NEST} - ${TR_LOOP_COMB} - ${TR_LOOP_SPLIT} - ${TR_PRIV_BR} - ${TR_SWAP_ARR_DIMS} - ${TR_FUNC_DUP} - ${TR_FUNC_PURE} - ${TR_LOOP_UNROLL} - ${TR_GV} - ${TR_PRIV_DEL} + ${TR_DEAD_CODE} + ${TR_CP} + ${TR_VECTOR} + ${TR_ENDDO_LOOP} + ${TR_LOOP_NEST} + ${TR_LOOP_COMB} + ${TR_LOOP_SPLIT} + ${TR_PRIV_BR} + ${TR_SWAP_ARR_DIMS} + ${TR_FUNC_DUP} + ${TR_FUNC_PURE} + ${TR_LOOP_UNROLL} + ${TR_GV} + ${TR_PRIV_DEL} ${TR_CONV} - ${TR_PRIV_DEL} - ${TR_IMPLICIT_NONE}) - + ${TR_PRIV_DEL} + ${TR_IMPLICIT_NONE}) + set(CFG _src/CFGraph/IR.cpp - _src/CFGraph/IR.h - _src/CFGraph/CFGraph.cpp - _src/CFGraph/CFGraph.h - _src/CFGraph/RD_subst.cpp - _src/CFGraph/RD_subst.h - _src/CFGraph/live_variable_analysis.cpp - _src/CFGraph/live_variable_analysis.h - _src/CFGraph/private_variables_analysis.cpp - _src/CFGraph/private_variables_analysis.h - ) - + _src/CFGraph/IR.h + _src/CFGraph/CFGraph.cpp + _src/CFGraph/CFGraph.h + _src/CFGraph/RD_subst.cpp + _src/CFGraph/RD_subst.h + _src/CFGraph/live_variable_analysis.cpp + _src/CFGraph/live_variable_analysis.h + _src/CFGraph/private_variables_analysis.cpp + _src/CFGraph/private_variables_analysis.h + ) + set(DATA_FLOW - _src/CFGraph/DataFlow/data_flow.h - _src/CFGraph/DataFlow/data_flow_impl.h - _src/CFGraph/DataFlow/backward_data_flow.h - _src/CFGraph/DataFlow/backward_data_flow_impl.h - ) + _src/CFGraph/DataFlow/data_flow.h + _src/CFGraph/DataFlow/data_flow_impl.h + _src/CFGraph/DataFlow/backward_data_flow.h + _src/CFGraph/DataFlow/backward_data_flow_impl.h + ) -set(CREATE_INTER_T _src/CreateInterTree/CreateInterTree.cpp - _src/CreateInterTree/CreateInterTree.h) +set(CREATE_INTER_T _src/CreateInterTree/CreateInterTree.cpp + _src/CreateInterTree/CreateInterTree.h) set(DIRA _src/DirectiveProcessing/DirectiveAnalyzer.cpp - _src/DirectiveProcessing/DirectiveAnalyzer.h - _src/DirectiveProcessing/directive_creator.cpp - _src/DirectiveProcessing/directive_creator_base.cpp - _src/DirectiveProcessing/directive_creator.h - _src/DirectiveProcessing/directive_creator_base_nodist.cpp - _src/DirectiveProcessing/directive_creator_nodist.h - _src/DirectiveProcessing/directive_creator_internal.h - _src/DirectiveProcessing/directive_parser.cpp - _src/DirectiveProcessing/directive_parser.h + _src/DirectiveProcessing/DirectiveAnalyzer.h + _src/DirectiveProcessing/directive_creator.cpp + _src/DirectiveProcessing/directive_creator_base.cpp + _src/DirectiveProcessing/directive_creator.h + _src/DirectiveProcessing/directive_creator_base_nodist.cpp + _src/DirectiveProcessing/directive_creator_nodist.h + _src/DirectiveProcessing/directive_creator_internal.h + _src/DirectiveProcessing/directive_parser.cpp + _src/DirectiveProcessing/directive_parser.h _src/DirectiveProcessing/insert_directive.cpp - _src/DirectiveProcessing/insert_directive.h - _src/DirectiveProcessing/remote_access.cpp - _src/DirectiveProcessing/remote_access_base.cpp - _src/DirectiveProcessing/remote_access.h - _src/DirectiveProcessing/shadow.cpp - _src/DirectiveProcessing/shadow.h - _src/DirectiveProcessing/spf_directive_preproc.cpp) - + _src/DirectiveProcessing/insert_directive.h + _src/DirectiveProcessing/remote_access.cpp + _src/DirectiveProcessing/remote_access_base.cpp + _src/DirectiveProcessing/remote_access.h + _src/DirectiveProcessing/shadow.cpp + _src/DirectiveProcessing/shadow.h + _src/DirectiveProcessing/spf_directive_preproc.cpp) + set(DISTR _src/Distribution/Array.cpp _src/Distribution/Array.h _src/Distribution/Arrays.h _src/Distribution/CreateDistributionDirs.cpp - _src/Distribution/CreateDistributionDirs.h + _src/Distribution/CreateDistributionDirs.h _src/Distribution/Cycle.cpp - _src/Distribution/Cycle.h + _src/Distribution/Cycle.h _src/Distribution/Distribution.cpp - _src/Distribution/Distribution.h + _src/Distribution/Distribution.h _src/Distribution/DvmhDirective.cpp - _src/Distribution/DvmhDirective.h - _src/Distribution/DvmhDirective_nodist.cpp - _src/Distribution/DvmhDirective_internal.h - _src/Distribution/DvmhDirective_func.h + _src/Distribution/DvmhDirective.h + _src/Distribution/DvmhDirective_nodist.cpp + _src/Distribution/DvmhDirective_internal.h + _src/Distribution/DvmhDirective_func.h _src/Distribution/DvmhDirectiveBase.cpp _src/Distribution/DvmhDirectiveBase_nodist.cpp - _src/Distribution/DvmhDirectiveBase.h + _src/Distribution/DvmhDirectiveBase.h _src/Distribution/GraphCSR.cpp - _src/Distribution/GraphCSR.h) - + _src/Distribution/GraphCSR.h) + set(DVMH_REG _src/DvmhRegions/DvmhRegionInserter.cpp - _src/DvmhRegions/DvmhRegionInserter.h - _src/DvmhRegions/RegionsMerger.cpp - _src/DvmhRegions/RegionsMerger.h - _src/DvmhRegions/ReadWriteAnalyzer.cpp - _src/DvmhRegions/ReadWriteAnalyzer.h - _src/DvmhRegions/LoopChecker.cpp - _src/DvmhRegions/LoopChecker.h - _src/DvmhRegions/DvmhRegion.cpp - _src/DvmhRegions/DvmhRegion.h - _src/DvmhRegions/VarUsages.cpp - _src/DvmhRegions/VarUsages.h - _src/DvmhRegions/TypedSymbol.cpp - _src/DvmhRegions/TypedSymbol.h) - + _src/DvmhRegions/DvmhRegionInserter.h + _src/DvmhRegions/RegionsMerger.cpp + _src/DvmhRegions/RegionsMerger.h + _src/DvmhRegions/ReadWriteAnalyzer.cpp + _src/DvmhRegions/ReadWriteAnalyzer.h + _src/DvmhRegions/LoopChecker.cpp + _src/DvmhRegions/LoopChecker.h + _src/DvmhRegions/DvmhRegion.cpp + _src/DvmhRegions/DvmhRegion.h + _src/DvmhRegions/VarUsages.cpp + _src/DvmhRegions/VarUsages.h + _src/DvmhRegions/TypedSymbol.cpp + _src/DvmhRegions/TypedSymbol.h) + set(DYNA _src/DynamicAnalysis/createParallelRegions.cpp - _src/DynamicAnalysis/createParallelRegions.h - _src/DynamicAnalysis/gcov_info.cpp - _src/DynamicAnalysis/gcov_info.h - _src/DynamicAnalysis/gCov_parser.cpp - _src/DynamicAnalysis/gCov_parser_func.h) + _src/DynamicAnalysis/createParallelRegions.h + _src/DynamicAnalysis/gcov_info.cpp + _src/DynamicAnalysis/gcov_info.h + _src/DynamicAnalysis/gCov_parser.cpp + _src/DynamicAnalysis/gCov_parser_func.h) set(EXPR_TRANSFORM _src/ExpressionTransform/control_flow_graph_part.cpp - _src/ExpressionTransform/expr_transform.cpp - _src/ExpressionTransform/expr_transform.h) - + _src/ExpressionTransform/expr_transform.cpp + _src/ExpressionTransform/expr_transform.h) + set(GR_CALL _src/GraphCall/graph_calls.cpp - _src/GraphCall/graph_calls.h - _src/GraphCall/graph_calls_base.cpp - _src/GraphCall/graph_calls_func.h - _src/GraphCall/select_array_conf.cpp - _src/GraphCall/select_array_conf.h) - + _src/GraphCall/graph_calls.h + _src/GraphCall/graph_calls_base.cpp + _src/GraphCall/graph_calls_func.h + _src/GraphCall/select_array_conf.cpp + _src/GraphCall/select_array_conf.h) + set(GR_LOOP _src/GraphLoop/graph_loops_base.cpp _src/GraphLoop/graph_loops.cpp - _src/GraphLoop/graph_loops.h - _src/GraphLoop/graph_loops_func.h) - + _src/GraphLoop/graph_loops.h + _src/GraphLoop/graph_loops_func.h) + set(INLINER _src/Inliner/inliner.cpp - _src/Inliner/inliner.h) - + _src/Inliner/inliner.h) + set(LOOP_ANALYZER _src/LoopAnalyzer/allocations_prepoc.cpp _src/LoopAnalyzer/dep_analyzer.cpp _src/LoopAnalyzer/loop_analyzer.cpp _src/LoopAnalyzer/loop_analyzer_nodist.cpp - _src/LoopAnalyzer/loop_analyzer_nodist.h - _src/LoopAnalyzer/loop_analyzer_internal.h - _src/LoopAnalyzer/loop_analyzer.h) + _src/LoopAnalyzer/loop_analyzer_nodist.h + _src/LoopAnalyzer/loop_analyzer_internal.h + _src/LoopAnalyzer/loop_analyzer.h) set(RENAME_SYMBOLS _src/RenameSymbols/rename_symbols.cpp - _src/RenameSymbols/rename_symbols.h) - + _src/RenameSymbols/rename_symbols.h) + set(MAIN _src/Sapfor.cpp - _src/Sapfor.h - _src/SapforData.h - _src/Utils/PassManager.h) + _src/Sapfor.h + _src/SapforData.h + _src/Utils/PassManager.h) set(PREDICTOR _src/Predictor/PredictScheme.cpp _src/Predictor/PredictScheme.h) @@ -346,88 +346,88 @@ set(PROJ_MAN _src/ProjectManipulation/ParseFiles.cpp _src/ProjectManipulation/ConvertFiles.h) set(PARSER ${parser_sources}/cftn.c - ${parser_sources}/errors.c - ${parser_sources}/gram1.tab.c - ${parser_sources}/hash.c - ${parser_sources}/init.c - ${parser_sources}/lexfdvm.c - ${parser_sources}/lists.c - ${parser_sources}/low_hpf.c - ${parser_sources}/misc.c - ${parser_sources}/stat.c - ${parser_sources}/sym.c - ${parser_sources}/types.c - ${parser_sources}/unparse_hpf.c) + ${parser_sources}/errors.c + ${parser_sources}/gram1.tab.c + ${parser_sources}/hash.c + ${parser_sources}/init.c + ${parser_sources}/lexfdvm.c + ${parser_sources}/lists.c + ${parser_sources}/low_hpf.c + ${parser_sources}/misc.c + ${parser_sources}/stat.c + ${parser_sources}/sym.c + ${parser_sources}/types.c + ${parser_sources}/unparse_hpf.c) set(PPPA ${pppa_sources}/inter.cpp - ${pppa_sources}/potensyn.cpp - ${pppa_sources}/stat.cpp - ${pppa_sources}/statfile.cpp - ${pppa_sources}/statinter.cpp - ${pppa_sources}/statlist.cpp - ${pppa_sources}/statprintf.cpp - ${pppa_sources}/statread.cpp - ${pppa_sources}/treeinter.cpp - - ${pppa_sources}/bool.h - ${pppa_sources}/dvmh_stat.h - ${pppa_sources}/inter.h - ${pppa_sources}/potensyn.h - ${pppa_sources}/statist.h - ${pppa_sources}/statlist.h - ${pppa_sources}/statprintf.h - ${pppa_sources}/statread.h - ${pppa_sources}/strall.h - ${pppa_sources}/sysstat.h - ${pppa_sources}/treeinter.h - ${pppa_sources}/ver.h - ${pppa_sources}/statinter.h - ${pppa_sources}/json.hpp) - + ${pppa_sources}/potensyn.cpp + ${pppa_sources}/stat.cpp + ${pppa_sources}/statfile.cpp + ${pppa_sources}/statinter.cpp + ${pppa_sources}/statlist.cpp + ${pppa_sources}/statprintf.cpp + ${pppa_sources}/statread.cpp + ${pppa_sources}/treeinter.cpp + + ${pppa_sources}/bool.h + ${pppa_sources}/dvmh_stat.h + ${pppa_sources}/inter.h + ${pppa_sources}/potensyn.h + ${pppa_sources}/statist.h + ${pppa_sources}/statlist.h + ${pppa_sources}/statprintf.h + ${pppa_sources}/statread.h + ${pppa_sources}/strall.h + ${pppa_sources}/sysstat.h + ${pppa_sources}/treeinter.h + ${pppa_sources}/ver.h + ${pppa_sources}/statinter.h + ${pppa_sources}/json.hpp) + set(ZLIB ${zlib_sources}/src/adler32.c - ${zlib_sources}/src/compress.c - ${zlib_sources}/src/crc32.c - ${zlib_sources}/src/deflate.c - ${zlib_sources}/src/gzio.c - ${zlib_sources}/src/infblock.c - ${zlib_sources}/src/infcodes.c - ${zlib_sources}/src/inffast.c - ${zlib_sources}/src/inflate.c - ${zlib_sources}/src/inftrees.c - ${zlib_sources}/src/infutil.c - ${zlib_sources}/src/trees.c - ${zlib_sources}/src/uncompr.c - ${zlib_sources}/src/zutil.c) + ${zlib_sources}/src/compress.c + ${zlib_sources}/src/crc32.c + ${zlib_sources}/src/deflate.c + ${zlib_sources}/src/gzio.c + ${zlib_sources}/src/infblock.c + ${zlib_sources}/src/infcodes.c + ${zlib_sources}/src/inffast.c + ${zlib_sources}/src/inflate.c + ${zlib_sources}/src/inftrees.c + ${zlib_sources}/src/infutil.c + ${zlib_sources}/src/trees.c + ${zlib_sources}/src/uncompr.c + ${zlib_sources}/src/zutil.c) -set(SOURCE_EXE - ${CFG} - ${DATA_FLOW} - ${CREATE_INTER_T} - ${DIRA} - ${DISTR} - ${DVMH_REG} - ${DYNA} - ${EXPR_TRANSFORM} - ${GR_CALL} - ${GR_LOOP} - ${INLINER} - ${LOOP_ANALYZER} - ${RENAME_SYMBOLS} - ${TRANSFORMS} - ${PARALLEL_REG} - ${PRIV} - ${FDVM} - ${OMEGA} - ${UTILS} - ${VERIF} - ${VS_CALLS} - ${MAIN} - ${PREDICTOR} - ${PARSER} - ${PPPA} - ${ZLIB} - ${GR_LAYOUT} - ${PR_PARAM} +set(SOURCE_EXE + ${CFG} + ${DATA_FLOW} + ${CREATE_INTER_T} + ${DIRA} + ${DISTR} + ${DVMH_REG} + ${DYNA} + ${EXPR_TRANSFORM} + ${GR_CALL} + ${GR_LOOP} + ${INLINER} + ${LOOP_ANALYZER} + ${RENAME_SYMBOLS} + ${TRANSFORMS} + ${PARALLEL_REG} + ${PRIV} + ${FDVM} + ${OMEGA} + ${UTILS} + ${VERIF} + ${VS_CALLS} + ${MAIN} + ${PREDICTOR} + ${PARSER} + ${PPPA} + ${ZLIB} + ${GR_LAYOUT} + ${PR_PARAM} ${PROJ_MAN}) add_executable(Sapfor_F ${SOURCE_EXE}) @@ -464,11 +464,11 @@ source_group (GraphCall FILES ${GR_CALL}) source_group (GraphLoop FILES ${GR_LOOP}) source_group (LoopAnalyzer FILES ${LOOP_ANALYZER}) source_group (ParallelizationRegions FILES ${PARALLEL_REG}) -source_group (PrivateAnalyzer FILES ${PRIV}) +source_group (PrivateAnalyzer FILES ${PRIV}) source_group (FDVM_Compiler FILES ${FDVM}) source_group (SageExtension FILES ${OMEGA}) source_group (Utils FILES ${UTILS}) -source_group (VerificationCode FILES ${VERIF}) +source_group (VerificationCode FILES ${VERIF}) source_group (ProjectParameters FILES ${PR_PARAM}) source_group (ProjectManipulation FILES ${PROJ_MAN}) @@ -508,15 +508,15 @@ add_definitions("-D __SPF_BUILT_IN_PARSER") add_definitions("-D __SPF_BUILT_IN_PPPA") if (WIN32) - target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc) + target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc) elseif(UNIX) - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) - target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc pthread stdc++fs) - else() - target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc pthread) - endif() + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) + target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc pthread stdc++fs) + else() + target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc pthread) + endif() endif() #install(TARGETS # LIBRARY DESTINATION -# RUNTIME DESTINATION ) +# RUNTIME DESTINATION ) diff --git a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp index 7b2b1e2..c73372a 100644 --- a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp @@ -1175,7 +1175,7 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne else if (curr_regime == CONVERT_TO_C) covertToC(file); else if (curr_regime == SET_IMPLICIT_NONE) - ImplicitCheck(file); + implicitCheck(file); else if (curr_regime == INSERT_NO_DISTR_FLAGS_FROM_GUI) addPrivatesToArraysFromGUI(file, declaredArrays, distrStateFromGUI); else if (curr_regime == REMOVE_DEAD_CODE) diff --git a/sapfor/experts/Sapfor_2017/_src/Transformations/set_implicit_none.cpp b/sapfor/experts/Sapfor_2017/_src/Transformations/set_implicit_none.cpp index 12e3b27..bd0cc7f 100644 --- a/sapfor/experts/Sapfor_2017/_src/Transformations/set_implicit_none.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Transformations/set_implicit_none.cpp @@ -15,179 +15,179 @@ static const char commonIntLetters[6] = { 'i', 'j', 'k', 'm', 'n', 'l' }; static void InitTypes(map& types) { - for (char letter = 'a'; letter <= 'z'; letter++) - types[letter] = 0; + for (char letter = 'a'; letter <= 'z'; letter++) + types[letter] = 0; } static void FillCommonTypes(map& types) { - for (char letter : commonIntLetters) - if (types[letter] == 0) - types[letter] = new SgType(T_INT); + for (char letter : commonIntLetters) + if (types[letter] == 0) + types[letter] = new SgType(T_INT); - for (auto letter : types) - if (letter.second == NULL) - types[letter.first] = new SgType(T_FLOAT); + for (auto letter : types) + if (letter.second == NULL) + types[letter.first] = new SgType(T_FLOAT); } static void FindAllVars(SgExpression* expr, set& allVars) { - if (expr == NULL) - return; + if (expr == NULL) + return; - if (expr->variant() == VAR_REF || expr->variant() == ARRAY_REF) - allVars.insert(expr->symbol()); + if (expr->variant() == VAR_REF || expr->variant() == ARRAY_REF) + allVars.insert(expr->symbol()); - FindAllVars(expr->lhs(), allVars); - FindAllVars(expr->rhs(), allVars); + FindAllVars(expr->lhs(), allVars); + FindAllVars(expr->rhs(), allVars); } static char getValue(SgExpression* ex) { - char charVal = 0; - if (ex && ex->variant() == CHAR_VAL) - charVal = isSgValueExp(ex)->charValue(); - return charVal; + char charVal = 0; + if (ex && ex->variant() == CHAR_VAL) + charVal = isSgValueExp(ex)->charValue(); + return charVal; } static void AddLettersToMap(SgExpression* expr, SgType* type, map& types) { - while (expr) - { - if (expr->variant() != EXPR_LIST) - printInternalError(convertFileName(__FILE__).c_str(), __LINE__); + while (expr) + { + if (expr->variant() != EXPR_LIST) + printInternalError(convertFileName(__FILE__).c_str(), __LINE__); - SgExpression* val = expr->lhs(); - if (val->variant() == DDOT) - { - char leftVal = getValue(val->lhs()); - char rightVal = getValue(val->rhs()); + SgExpression* val = expr->lhs(); + if (val->variant() == DDOT) + { + char leftVal = getValue(val->lhs()); + char rightVal = getValue(val->rhs()); - if (leftVal == 0 || rightVal == 0) - printInternalError(convertFileName(__FILE__).c_str(), __LINE__); + if (leftVal == 0 || rightVal == 0) + printInternalError(convertFileName(__FILE__).c_str(), __LINE__); - for (char letter = leftVal; letter <= rightVal; letter++) - types[letter] = type; - } - else - { - char charVal = getValue(val); - if (charVal == 0) - printInternalError(convertFileName(__FILE__).c_str(), __LINE__); + for (char letter = leftVal; letter <= rightVal; letter++) + types[letter] = type; + } + else + { + char charVal = getValue(val); + if (charVal == 0) + printInternalError(convertFileName(__FILE__).c_str(), __LINE__); - types[charVal] = type; - } + types[charVal] = type; + } - expr = expr->rhs(); - } + expr = expr->rhs(); + } } static map FunctionImplicitCheck(SgStatement* function, const map>& typesByFunctions) { - set allVars; - map types; - vector varsWithoutDecl; - - InitTypes(types); - FillCommonTypes(types); + set allVars; + map types; + vector varsWithoutDecl; + + InitTypes(types); + FillCommonTypes(types); - auto cp = function->controlParent(); - if (isSgProgHedrStmt(cp)) - if (typesByFunctions.find(cp) != typesByFunctions.end()) - for (auto& parentType : typesByFunctions.at(cp)) - types[parentType.first] = parentType.second; + auto cp = function->controlParent(); + if (isSgProgHedrStmt(cp)) + if (typesByFunctions.find(cp) != typesByFunctions.end()) + for (auto& parentType : typesByFunctions.at(cp)) + types[parentType.first] = parentType.second; - auto hasImplicitNone = false; - auto endOfFunc = function->lastNodeOfStmt(); - for (auto st = function; st != endOfFunc; st = st->lexNext()) - { - if (st->variant() == IMPL_DECL) - { - SgImplicitStmt* implicitStatement = isSgImplicitStmt(st); - if (implicitStatement != NULL) - { - const int numberOfTypes = implicitStatement->numberOfImplicitTypes(); + auto hasImplicitNone = false; + auto endOfFunc = function->lastNodeOfStmt(); + for (auto st = function; st != endOfFunc; st = st->lexNext()) + { + if (st->variant() == IMPL_DECL) + { + SgImplicitStmt* implicitStatement = isSgImplicitStmt(st); + if (implicitStatement != NULL) + { + const int numberOfTypes = implicitStatement->numberOfImplicitTypes(); - if (numberOfTypes > 0) - { - for (int j = 0; j < numberOfTypes; ++j) - { - SgType* type = implicitStatement->implicitType(j); - SgExpression* lettersExpression = implicitStatement->implicitRangeList(j); + if (numberOfTypes > 0) + { + for (int j = 0; j < numberOfTypes; ++j) + { + SgType* type = implicitStatement->implicitType(j); + SgExpression* lettersExpression = implicitStatement->implicitRangeList(j); - AddLettersToMap(lettersExpression, type, types); - } - } - else - hasImplicitNone = true; - } - } - else if (st->variant() == CONTAINS_STMT || isSgExecutableStatement(st) != NULL) - break; - } + AddLettersToMap(lettersExpression, type, types); + } + } + else + hasImplicitNone = true; + } + } + else if (st->variant() == CONTAINS_STMT || isSgExecutableStatement(st) != NULL) + break; + } - for (auto st = function; st != endOfFunc && st->variant() != CONTAINS_STMT; st = st->lexNext()) - for (int i = 0; i < 3; ++i) - FindAllVars(st->expr(i), allVars); + for (auto st = function; st != endOfFunc && st->variant() != CONTAINS_STMT; st = st->lexNext()) + for (int i = 0; i < 3; ++i) + FindAllVars(st->expr(i), allVars); - for (auto& var : allVars) - { - if (string(var->identifier()) == function->symbol()->identifier()) - continue; + for (auto& var : allVars) + { + if (string(var->identifier()) == function->symbol()->identifier()) + continue; - vector _; - SgStatement* declaredInStatement = declaratedInStmt(var, &_, false); - if (declaredInStatement == NULL) - { - const char c = var->identifier()[0]; + vector _; + SgStatement* declaredInStatement = declaratedInStmt(var, &_, false); + if (declaredInStatement == NULL) + { + const char c = var->identifier()[0]; - if (types.find(c) != types.end()) - var->setType(types[c]); + if (types.find(c) != types.end()) + var->setType(types[c]); - varsWithoutDecl.push_back(var); - } - } + varsWithoutDecl.push_back(var); + } + } - makeDeclaration(varsWithoutDecl, function, NULL); + makeDeclaration(varsWithoutDecl, function, NULL); - if (!hasImplicitNone) - { - for (auto st = function->lexNext(); - st != endOfFunc && st->variant() != CONTAINS_STMT && isSgExecutableStatement(st) == NULL; - ) - { - if (st->variant() == IMPL_DECL) - { - auto tmpStatement = st; - st = st->lexNext(); - tmpStatement->deleteStmt(); - } - else - st = st->lexNext(); - } + if (!hasImplicitNone) + { + for (auto st = function->lexNext(); + st != endOfFunc && st->variant() != CONTAINS_STMT && isSgExecutableStatement(st) == NULL; + ) + { + if (st->variant() == IMPL_DECL) + { + auto tmpStatement = st; + st = st->lexNext(); + tmpStatement->deleteStmt(); + } + else + st = st->lexNext(); + } - auto implNone = new SgStatement(IMPL_DECL); - implNone->setlineNumber(function->lineNumber()); - implNone->setFileName(function->fileName()); + auto implNone = new SgStatement(IMPL_DECL); + implNone->setlineNumber(function->lineNumber()); + implNone->setFileName(function->fileName()); - function->insertStmtAfter(*implNone, *function); - } + function->insertStmtAfter(*implNone, *function); + } - allVars.clear(); - varsWithoutDecl.clear(); + allVars.clear(); + varsWithoutDecl.clear(); - return types; + return types; } -void ImplicitCheck(SgFile* file) +void implicitCheck(SgFile* file) { - map> typesByFunctions; + map> typesByFunctions; - for (int func = 0; func < file->numberOfFunctions(); ++func) - { - SgStatement* function = file->functions(func); - typesByFunctions[function] = FunctionImplicitCheck(function, typesByFunctions); - } + for (int func = 0; func < file->numberOfFunctions(); ++func) + { + SgStatement* function = file->functions(func); + typesByFunctions[function] = FunctionImplicitCheck(function, typesByFunctions); + } - typesByFunctions.clear(); + typesByFunctions.clear(); } diff --git a/sapfor/experts/Sapfor_2017/_src/Transformations/set_implicit_none.h b/sapfor/experts/Sapfor_2017/_src/Transformations/set_implicit_none.h index 6d7e4bd..03e600c 100644 --- a/sapfor/experts/Sapfor_2017/_src/Transformations/set_implicit_none.h +++ b/sapfor/experts/Sapfor_2017/_src/Transformations/set_implicit_none.h @@ -1,3 +1,3 @@ #pragma once -void ImplicitCheck(SgFile* file); \ No newline at end of file +void implicitCheck(SgFile* file); \ No newline at end of file