#35 — Her AST düğüm tipine sanal yıkıcı eklendi; ~ASTNode() children vektörünü, alt sınıf yıkıcıları typed pointer'larını (condition, Left/Right, initExpr, params…) özyinelemeli siler. FunctionDeclNode yıkıcısı incomplete type uyarısını önlemek için .cpp'ye taşındı. DCE'deki erase sırası da düzeltildi: remove_if → delete → erase (önceki sırayla dangling pointer üzerinde dynamic_cast yapılıyordu → segfault). #36 — DeadCodeElimPass artık DiagnosticEngine& alıyor; unreachable düğüm işaretlendiğinde W003 raporu üretiliyor (saqut run --optimized ile görünür). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
77bcd1c9d6
commit
4accdf8484
Binary file not shown.
|
|
@ -1,22 +1,34 @@
|
||||||
# ninja log v5
|
# ninja log v7
|
||||||
1 14 0 /home/user/saqut/build/CMakeFiles/cmake.verify_globs 238c709815bc8219
|
1 9 1781900092189939762 /home/saqut/Masaüstü/saqutcompiler/build/CMakeFiles/cmake.verify_globs 1813c41e0f312d7e
|
||||||
15 2138 1781895034863034049 CMakeFiles/saqut.dir/src/ir/ir_function.cpp.o cbac11a413b703b3
|
10 1691 1781900092199402809 CMakeFiles/saqut.dir/src/ir/ir_program.cpp.o d681b36458a6e5f5
|
||||||
15 2238 1781895034971034047 CMakeFiles/saqut.dir/src/ir/ir_program.cpp.o 90ef73914dbb606c
|
10 1957 1781900092199188672 CMakeFiles/saqut.dir/src/ir/ir_function.cpp.o 85cbc174284792d4
|
||||||
16 8094 1781895040827033913 CMakeFiles/saqut.dir/src/lexer/lexer.cpp.o 2ea22cbb79062d15
|
10 5411 1781900092199511505 CMakeFiles/saqut.dir/src/lexer/lexer.cpp.o 90eeec811f2137e6
|
||||||
15 8520 1781895041247033903 CMakeFiles/saqut.dir/src/core/sourcefile.cpp.o cb16fa02b773057a
|
10 5413 1781900092198939716 CMakeFiles/saqut.dir/src/core/sourcefile.cpp.o da6f5fc90e87e6b1
|
||||||
15 9700 1781895042423033876 CMakeFiles/saqut.dir/src/ir/ir_generator.cpp.o e19fb717c9eced0f
|
10 6729 1781900092199847028 CMakeFiles/saqut.dir/src/parser/nodes/declarations.cpp.o b6c56f04a257f685
|
||||||
2138 10938 1781895043655033848 CMakeFiles/saqut.dir/src/parser/nodes/binary_expr.cpp.o 97ce1a5bc3eb248e
|
15 7732 1781900092203939691 CMakeFiles/saqut.dir/src/parser/nodes/expressions.cpp.o 4057e3d63c63a1ab
|
||||||
2238 12199 1781895044907033820 CMakeFiles/saqut.dir/src/parser/nodes/declarations.cpp.o 6fecf8ca87c7860e
|
10 8908 1781900092199302769 CMakeFiles/saqut.dir/src/ir/ir_generator.cpp.o 84c9f816f969cfa7
|
||||||
8520 14486 1781895047175033768 CMakeFiles/saqut.dir/src/parser/nodes/identifier.cpp.o 4de36e77820fc5df
|
10 9701 1781900092199743167 CMakeFiles/saqut.dir/src/parser/nodes/binary_expr.cpp.o d2e2bb2f8a63c6d2
|
||||||
8094 14974 1781895047667033756 CMakeFiles/saqut.dir/src/parser/nodes/expressions.cpp.o 46e98e7a6fb7c917
|
1709 9770 1781900093898639567 CMakeFiles/saqut.dir/src/parser/nodes/literal.cpp.o 78f2c4da7c9b2281
|
||||||
18 15610 1781895048283033742 CMakeFiles/saqut.dir/src/main.cpp.o a73db9c39df1da69
|
15 10364 1781900092204948414 CMakeFiles/saqut.dir/src/parser/nodes/identifier.cpp.o eb96bb4b1eb4ad80
|
||||||
9700 16977 1781895049691033710 CMakeFiles/saqut.dir/src/parser/nodes/literal.cpp.o 35acf8e2871d7fe3
|
1957 11871 1781900094145929879 CMakeFiles/saqut.dir/src/parser/nodes/program.cpp.o ac5bbcd74d87561a
|
||||||
10938 17266 1781895049975033704 CMakeFiles/saqut.dir/src/parser/nodes/program.cpp.o d3a2b346b12873af
|
9770 11899 1781900101958890478 CMakeFiles/saqut.dir/src/vm/interpreter.cpp.o 88078036625564ef
|
||||||
14487 18692 1781895051419033671 CMakeFiles/saqut.dir/src/parser/parser.cpp.o 138e1ef256695c97
|
5413 11959 1781900097601912436 CMakeFiles/saqut.dir/src/parser/parser.cpp.o 2c65b7be26cead32
|
||||||
12199 19143 1781895051851033661 CMakeFiles/saqut.dir/src/parser/nodes/statements.cpp.o 5e96853303a0d3b3
|
10 12284 1781900092199621706 CMakeFiles/saqut.dir/src/main.cpp.o 110c26cb1d0c3a23
|
||||||
14978 19706 1781895052419033648 CMakeFiles/saqut.dir/src/semantic/structural_validator.cpp.o dd40374839446f0f
|
6729 13187 1781900098917905800 CMakeFiles/saqut.dir/src/semantic/structural_validator.cpp.o 4bfec8abc0e9893e
|
||||||
18692 20133 1781895052863033638 CMakeFiles/saqut.dir/src/vm/interpreter.cpp.o 85852a3a0ea4d9d
|
5412 13356 1781900097601088348 CMakeFiles/saqut.dir/src/parser/nodes/statements.cpp.o b5c20724bbf3648c
|
||||||
17266 20502 1781895053231033629 CMakeFiles/saqut.dir/src/tokenizer/tokenizer.cpp.o 625d723d056771d0
|
7733 14099 1781900099922227854 CMakeFiles/saqut.dir/src/semantic/type_checker.cpp.o 15f44776b9c3e26d
|
||||||
15610 20694 1781895053419033625 CMakeFiles/saqut.dir/src/semantic/type_checker.cpp.o 674ce30e334d4450
|
9701 14179 1781900101889890826 CMakeFiles/saqut.dir/src/tokenizer/tokenizer.cpp.o a01677f8bb4f4dbc
|
||||||
16977 21916 1781895054635033597 CMakeFiles/saqut.dir/src/symbol/symbol_collector.cpp.o fa4cafcade963927
|
8908 14635 1781900101096894819 CMakeFiles/saqut.dir/src/symbol/symbol_collector.cpp.o 3348f498f369213d
|
||||||
21916 22327 1781895055035033588 saqut 774709f20a9344e
|
14635 14953 1781900106823866003 saqut 8f3d7184b374150b
|
||||||
|
2 17 1781900144964675644 /home/saqut/Masaüstü/saqutcompiler/build/CMakeFiles/cmake.verify_globs 1813c41e0f312d7e
|
||||||
|
18 4193 1781900144981580253 CMakeFiles/saqut.dir/src/semantic/structural_validator.cpp.o 4bfec8abc0e9893e
|
||||||
|
18 4260 1781900144981478187 CMakeFiles/saqut.dir/src/parser/parser.cpp.o 2c65b7be26cead32
|
||||||
|
18 4852 1781900144981695435 CMakeFiles/saqut.dir/src/semantic/type_checker.cpp.o 15f44776b9c3e26d
|
||||||
|
18 4914 1781900144981374397 CMakeFiles/saqut.dir/src/parser/nodes/declarations.cpp.o b6c56f04a257f685
|
||||||
|
18 5211 1781900144980675565 CMakeFiles/saqut.dir/src/ir/ir_generator.cpp.o 84c9f816f969cfa7
|
||||||
|
18 5324 1781900144981813038 CMakeFiles/saqut.dir/src/symbol/symbol_collector.cpp.o 3348f498f369213d
|
||||||
|
18 6912 1781900144981279910 CMakeFiles/saqut.dir/src/main.cpp.o 110c26cb1d0c3a23
|
||||||
|
6912 7184 1781900151874641436 saqut 8f3d7184b374150b
|
||||||
|
1 8 1781900314792856660 /home/saqut/Masaüstü/saqutcompiler/build/CMakeFiles/cmake.verify_globs 1813c41e0f312d7e
|
||||||
|
9 4869 1781900314800856623 CMakeFiles/saqut.dir/src/main.cpp.o 110c26cb1d0c3a23
|
||||||
|
4869 5168 1781900319660833784 saqut 8f3d7184b374150b
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# This is the CMakeCache file.
|
# This is the CMakeCache file.
|
||||||
# For build in directory: /home/user/saqut/build
|
# For build in directory: /home/saqut/Masaüstü/saqutcompiler/build
|
||||||
# It was generated by CMake: /usr/bin/cmake
|
# It was generated by CMake: /usr/bin/cmake
|
||||||
# You can edit this file to change values found and used by cmake.
|
# You can edit this file to change values found and used by cmake.
|
||||||
# If you do not want to change any of the values, simply exit the editor.
|
# If you do not want to change any of the values, simply exit the editor.
|
||||||
|
|
@ -29,11 +29,11 @@ CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
|
||||||
|
|
||||||
//A wrapper around 'ar' adding the appropriate '--plugin' option
|
//A wrapper around 'ar' adding the appropriate '--plugin' option
|
||||||
// for the GCC compiler
|
// for the GCC compiler
|
||||||
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-13
|
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar
|
||||||
|
|
||||||
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
|
//A wrapper around 'ranlib' adding the appropriate '--plugin' option
|
||||||
// for the GCC compiler
|
// for the GCC compiler
|
||||||
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-13
|
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib
|
||||||
|
|
||||||
//Flags used by the CXX compiler during all build types.
|
//Flags used by the CXX compiler during all build types.
|
||||||
CMAKE_CXX_FLAGS:STRING=
|
CMAKE_CXX_FLAGS:STRING=
|
||||||
|
|
@ -68,11 +68,14 @@ CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
|
||||||
//Flags used by the linker during RELWITHDEBINFO builds.
|
//Flags used by the linker during RELWITHDEBINFO builds.
|
||||||
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
||||||
|
|
||||||
|
//Enable/Disable output of build database during the build.
|
||||||
|
CMAKE_EXPORT_BUILD_DATABASE:BOOL=
|
||||||
|
|
||||||
//Enable/Disable output of compile commands during generation.
|
//Enable/Disable output of compile commands during generation.
|
||||||
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
|
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
|
||||||
|
|
||||||
//Value Computed by CMake.
|
//Value Computed by CMake.
|
||||||
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/home/user/saqut/build/CMakeFiles/pkgRedirects
|
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/home/saqut/Masaüstü/saqutcompiler/build/CMakeFiles/pkgRedirects
|
||||||
|
|
||||||
//Install path prefix, prepended onto install directories.
|
//Install path prefix, prepended onto install directories.
|
||||||
CMAKE_INSTALL_PREFIX:PATH=/usr/local
|
CMAKE_INSTALL_PREFIX:PATH=/usr/local
|
||||||
|
|
@ -112,6 +115,9 @@ CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
|
||||||
//Path to a program.
|
//Path to a program.
|
||||||
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
|
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_COMPAT_VERSION:STATIC=
|
||||||
|
|
||||||
//Value Computed by CMake
|
//Value Computed by CMake
|
||||||
CMAKE_PROJECT_DESCRIPTION:STATIC=
|
CMAKE_PROJECT_DESCRIPTION:STATIC=
|
||||||
|
|
||||||
|
|
@ -121,6 +127,9 @@ CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
|
||||||
//Value Computed by CMake
|
//Value Computed by CMake
|
||||||
CMAKE_PROJECT_NAME:STATIC=saqut
|
CMAKE_PROJECT_NAME:STATIC=saqut
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_SPDX_LICENSE:STATIC=
|
||||||
|
|
||||||
//Value Computed by CMake
|
//Value Computed by CMake
|
||||||
CMAKE_PROJECT_VERSION:STATIC=0.1
|
CMAKE_PROJECT_VERSION:STATIC=0.1
|
||||||
|
|
||||||
|
|
@ -169,23 +178,23 @@ CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
|
||||||
//If set, runtime paths are not added when using shared libraries.
|
//If set, runtime paths are not added when using shared libraries.
|
||||||
CMAKE_SKIP_RPATH:BOOL=NO
|
CMAKE_SKIP_RPATH:BOOL=NO
|
||||||
|
|
||||||
//Flags used by the linker during the creation of static libraries
|
//Flags used by the archiver during the creation of static libraries
|
||||||
// during all build types.
|
// during all build types.
|
||||||
CMAKE_STATIC_LINKER_FLAGS:STRING=
|
CMAKE_STATIC_LINKER_FLAGS:STRING=
|
||||||
|
|
||||||
//Flags used by the linker during the creation of static libraries
|
//Flags used by the archiver during the creation of static libraries
|
||||||
// during DEBUG builds.
|
// during DEBUG builds.
|
||||||
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
|
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
|
||||||
|
|
||||||
//Flags used by the linker during the creation of static libraries
|
//Flags used by the archiver during the creation of static libraries
|
||||||
// during MINSIZEREL builds.
|
// during MINSIZEREL builds.
|
||||||
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
|
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
|
||||||
|
|
||||||
//Flags used by the linker during the creation of static libraries
|
//Flags used by the archiver during the creation of static libraries
|
||||||
// during RELEASE builds.
|
// during RELEASE builds.
|
||||||
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
|
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
|
||||||
|
|
||||||
//Flags used by the linker during the creation of static libraries
|
//Flags used by the archiver during the creation of static libraries
|
||||||
// during RELWITHDEBINFO builds.
|
// during RELWITHDEBINFO builds.
|
||||||
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
||||||
|
|
||||||
|
|
@ -202,13 +211,13 @@ CMAKE_TAPI:FILEPATH=CMAKE_TAPI-NOTFOUND
|
||||||
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
|
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
|
||||||
|
|
||||||
//Value Computed by CMake
|
//Value Computed by CMake
|
||||||
saqut_BINARY_DIR:STATIC=/home/user/saqut/build
|
saqut_BINARY_DIR:STATIC=/home/saqut/Masaüstü/saqutcompiler/build
|
||||||
|
|
||||||
//Value Computed by CMake
|
//Value Computed by CMake
|
||||||
saqut_IS_TOP_LEVEL:STATIC=ON
|
saqut_IS_TOP_LEVEL:STATIC=ON
|
||||||
|
|
||||||
//Value Computed by CMake
|
//Value Computed by CMake
|
||||||
saqut_SOURCE_DIR:STATIC=/home/user/saqut
|
saqut_SOURCE_DIR:STATIC=/home/saqut/Masaüstü/saqutcompiler
|
||||||
|
|
||||||
|
|
||||||
########################
|
########################
|
||||||
|
|
@ -220,11 +229,11 @@ CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1
|
||||||
//ADVANCED property for variable: CMAKE_AR
|
//ADVANCED property for variable: CMAKE_AR
|
||||||
CMAKE_AR-ADVANCED:INTERNAL=1
|
CMAKE_AR-ADVANCED:INTERNAL=1
|
||||||
//This is the directory where this CMakeCache.txt was created
|
//This is the directory where this CMakeCache.txt was created
|
||||||
CMAKE_CACHEFILE_DIR:INTERNAL=/home/user/saqut/build
|
CMAKE_CACHEFILE_DIR:INTERNAL=/home/saqut/Masaüstü/saqutcompiler/build
|
||||||
//Major version of cmake used to create the current loaded cache
|
//Major version of cmake used to create the current loaded cache
|
||||||
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
|
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=4
|
||||||
//Minor version of cmake used to create the current loaded cache
|
//Minor version of cmake used to create the current loaded cache
|
||||||
CMAKE_CACHE_MINOR_VERSION:INTERNAL=28
|
CMAKE_CACHE_MINOR_VERSION:INTERNAL=3
|
||||||
//Patch version of cmake used to create the current loaded cache
|
//Patch version of cmake used to create the current loaded cache
|
||||||
CMAKE_CACHE_PATCH_VERSION:INTERNAL=3
|
CMAKE_CACHE_PATCH_VERSION:INTERNAL=3
|
||||||
//Path to CMake executable.
|
//Path to CMake executable.
|
||||||
|
|
@ -251,6 +260,8 @@ CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||||
//ADVANCED property for variable: CMAKE_DLLTOOL
|
//ADVANCED property for variable: CMAKE_DLLTOOL
|
||||||
CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
|
CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
|
||||||
|
//Path to cache edit program executable.
|
||||||
|
CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake
|
||||||
//Executable file format
|
//Executable file format
|
||||||
CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
|
CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
|
||||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
|
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
|
||||||
|
|
@ -263,6 +274,8 @@ CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||||
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||||
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
|
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
|
||||||
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_EXPORT_BUILD_DATABASE
|
||||||
|
CMAKE_EXPORT_BUILD_DATABASE-ADVANCED:INTERNAL=1
|
||||||
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
|
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
|
||||||
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
|
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
|
||||||
//Name of external makefile project generator.
|
//Name of external makefile project generator.
|
||||||
|
|
@ -277,11 +290,13 @@ CMAKE_GENERATOR_PLATFORM:INTERNAL=
|
||||||
CMAKE_GENERATOR_TOOLSET:INTERNAL=
|
CMAKE_GENERATOR_TOOLSET:INTERNAL=
|
||||||
//Source directory with the top level CMakeLists.txt file for this
|
//Source directory with the top level CMakeLists.txt file for this
|
||||||
// project
|
// project
|
||||||
CMAKE_HOME_DIRECTORY:INTERNAL=/home/user/saqut
|
CMAKE_HOME_DIRECTORY:INTERNAL=/home/saqut/Masaüstü/saqutcompiler
|
||||||
//Install .so files without execute permission.
|
//Install .so files without execute permission.
|
||||||
CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1
|
CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0
|
||||||
//ADVANCED property for variable: CMAKE_LINKER
|
//ADVANCED property for variable: CMAKE_LINKER
|
||||||
CMAKE_LINKER-ADVANCED:INTERNAL=1
|
CMAKE_LINKER-ADVANCED:INTERNAL=1
|
||||||
|
//Name of CMakeLists files to read
|
||||||
|
CMAKE_LIST_FILE_NAME:INTERNAL=CMakeLists.txt
|
||||||
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
|
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
|
||||||
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
|
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
|
||||||
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
|
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
|
||||||
|
|
@ -309,7 +324,7 @@ CMAKE_RANLIB-ADVANCED:INTERNAL=1
|
||||||
//ADVANCED property for variable: CMAKE_READELF
|
//ADVANCED property for variable: CMAKE_READELF
|
||||||
CMAKE_READELF-ADVANCED:INTERNAL=1
|
CMAKE_READELF-ADVANCED:INTERNAL=1
|
||||||
//Path to CMake installation.
|
//Path to CMake installation.
|
||||||
CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.28
|
CMAKE_ROOT:INTERNAL=/usr/share/cmake
|
||||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
|
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
|
||||||
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
|
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
|
||||||
|
|
@ -342,6 +357,4 @@ CMAKE_TAPI-ADVANCED:INTERNAL=1
|
||||||
CMAKE_UNAME:INTERNAL=/usr/bin/uname
|
CMAKE_UNAME:INTERNAL=/usr/bin/uname
|
||||||
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
|
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
|
||||||
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
|
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
|
||||||
//linker supports push/pop state
|
|
||||||
_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED:INTERNAL=TRUE
|
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"InstallScripts" :
|
||||||
|
[
|
||||||
|
"/home/saqut/Masa\u00fcst\u00fc/saqutcompiler/build/cmake_install.cmake"
|
||||||
|
],
|
||||||
|
"Parallel" : false
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/home/user/saqut/build/CMakeFiles/saqut.dir
|
/home/saqut/Masaüstü/saqutcompiler/build/CMakeFiles/saqut.dir
|
||||||
/home/user/saqut/build/CMakeFiles/test.dir
|
/home/saqut/Masaüstü/saqutcompiler/build/CMakeFiles/test.dir
|
||||||
/home/user/saqut/build/CMakeFiles/edit_cache.dir
|
/home/saqut/Masaüstü/saqutcompiler/build/CMakeFiles/edit_cache.dir
|
||||||
/home/user/saqut/build/CMakeFiles/rebuild_cache.dir
|
/home/saqut/Masaüstü/saqutcompiler/build/CMakeFiles/rebuild_cache.dir
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,46 @@
|
||||||
# CMAKE generated file: DO NOT EDIT!
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
# Generated by CMake Version 3.28
|
# Generated by CMake Version 4.3
|
||||||
cmake_policy(SET CMP0009 NEW)
|
|
||||||
|
|
||||||
# ALL_GOLDEN_SQT at CMakeLists.txt:40 (file)
|
# ALL_GOLDEN_SQT at CMakeLists.txt:40 (file)
|
||||||
file(GLOB_RECURSE NEW_GLOB LIST_DIRECTORIES false "/home/user/saqut/tests/golden/*.sqt")
|
file(GLOB_RECURSE NEW_GLOB LIST_DIRECTORIES false "/home/saqut/Masaüstü/saqutcompiler/tests/golden/*.sqt")
|
||||||
set(OLD_GLOB
|
set(OLD_GLOB
|
||||||
"/home/user/saqut/tests/golden/arithmetic/basic.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/basic.sqt"
|
||||||
"/home/user/saqut/tests/golden/arithmetic/precedence.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/compound_mod.sqt"
|
||||||
"/home/user/saqut/tests/golden/fibonacci/fib.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/mod_by_zero.sqt"
|
||||||
"/home/user/saqut/tests/golden/logic/not_operator.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/precedence.sqt"
|
||||||
"/home/user/saqut/tests/golden/logic/short_circuit.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/fibonacci/fib.sqt"
|
||||||
"/home/user/saqut/tests/golden/loops/basic.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/logic/not_operator.sqt"
|
||||||
"/home/user/saqut/tests/golden/loops/do_while_once.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/logic/short_circuit.sqt"
|
||||||
"/home/user/saqut/tests/golden/loops/do_while_truthy.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/basic.sqt"
|
||||||
"/home/user/saqut/tests/golden/loops/for_break_continue.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/do_while_once.sqt"
|
||||||
"/home/user/saqut/tests/golden/loops/nested_break.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/do_while_truthy.sqt"
|
||||||
"/home/user/saqut/tests/golden/loops/while_break_continue.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/for_break_continue.sqt"
|
||||||
"/home/user/saqut/tests/golden/opt/dce.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/nested_break.sqt"
|
||||||
"/home/user/saqut/tests/golden/opt/folding.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/while_break_continue.sqt"
|
||||||
"/home/user/saqut/tests/golden/opt/run_opt.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/dce.sqt"
|
||||||
"/home/user/saqut/tests/golden/string/equality.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/folding.sqt"
|
||||||
"/home/user/saqut/tests/golden/string/hello.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/run_opt.sqt"
|
||||||
"/home/user/saqut/tests/golden/string/ordering_error.sqt"
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/string/equality.sqt"
|
||||||
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/string/hello.sqt"
|
||||||
|
"/home/saqut/Masaüstü/saqutcompiler/tests/golden/string/ordering_error.sqt"
|
||||||
)
|
)
|
||||||
if(NOT "${NEW_GLOB}" STREQUAL "${OLD_GLOB}")
|
if(NOT "${NEW_GLOB}" STREQUAL "${OLD_GLOB}")
|
||||||
message("-- GLOB mismatch!")
|
message("-- GLOB mismatch!")
|
||||||
file(TOUCH_NOCREATE "/home/user/saqut/build/CMakeFiles/cmake.verify_globs")
|
set(NEW_ONLY ${NEW_GLOB})
|
||||||
|
set(OLD_ONLY ${OLD_GLOB})
|
||||||
|
list(REMOVE_ITEM NEW_ONLY ${OLD_GLOB})
|
||||||
|
list(REMOVE_ITEM OLD_ONLY ${NEW_GLOB})
|
||||||
|
if(NEW_ONLY)
|
||||||
|
message("The following files were added:")
|
||||||
|
foreach(VAR_FILE IN LISTS NEW_ONLY)
|
||||||
|
message(" +${VAR_FILE}")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
if(OLD_ONLY)
|
||||||
|
message("The following files were removed:")
|
||||||
|
foreach(VAR_FILE IN LISTS OLD_ONLY)
|
||||||
|
message(" -${VAR_FILE}")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
file(TOUCH_NOCREATE "/home/saqut/Masaüstü/saqutcompiler/build/CMakeFiles/cmake.verify_globs")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# CMAKE generated file: DO NOT EDIT!
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
# Generated by "Ninja" Generator, CMake Version 3.28
|
# Generated by "Ninja" Generator, CMake Version 4.3
|
||||||
|
|
||||||
# This file contains all the rules used to get the outputs files
|
# This file contains all the rules used to get the outputs files
|
||||||
# built from the input files.
|
# built from the input files.
|
||||||
|
|
@ -11,6 +11,36 @@
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for generating CXX dependencies.
|
||||||
|
|
||||||
|
rule CXX_SCAN__saqut_Debug
|
||||||
|
depfile = $DEP_FILE
|
||||||
|
command = /usr/bin/c++ $DEFINES $INCLUDES $FLAGS -E -x c++ $in -MT $DYNDEP_INTERMEDIATE_FILE -MD -MF $DEP_FILE -fmodules-ts -fdeps-file=$DYNDEP_INTERMEDIATE_FILE -fdeps-target=$OBJ_FILE -fdeps-format=p1689r5 -o $PREPROCESSED_OUTPUT_FILE
|
||||||
|
description = Scanning $in for CXX dependencies
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule to generate ninja dyndep files for CXX.
|
||||||
|
|
||||||
|
rule CXX_DYNDEP__saqut_Debug
|
||||||
|
command = /usr/bin/cmake -E cmake_ninja_dyndep --tdi=CMakeFiles/saqut.dir/CXXDependInfo.json --lang=CXX --modmapfmt=gcc --dd=$out @$out.rsp
|
||||||
|
description = Generating CXX dyndep file $out
|
||||||
|
rspfile = $out.rsp
|
||||||
|
rspfile_content = $in
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for compiling CXX files.
|
||||||
|
|
||||||
|
rule CXX_COMPILER__saqut_scanned_Debug
|
||||||
|
depfile = $DEP_FILE
|
||||||
|
deps = gcc
|
||||||
|
command = ${LAUNCHER}${CODE_CHECK}/usr/bin/c++ $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -fmodules-ts -fmodule-mapper=$DYNDEP_MODULE_MAP_FILE -MD -fdeps-format=p1689r5 -x c++ -o $out -c $in
|
||||||
|
description = Building CXX object $out
|
||||||
|
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
# Rule for compiling CXX files.
|
# Rule for compiling CXX files.
|
||||||
|
|
||||||
|
|
@ -25,6 +55,8 @@ rule CXX_COMPILER__saqut_unscanned_Debug
|
||||||
# Rule for linking CXX executable.
|
# Rule for linking CXX executable.
|
||||||
|
|
||||||
rule CXX_EXECUTABLE_LINKER__saqut_Debug
|
rule CXX_EXECUTABLE_LINKER__saqut_Debug
|
||||||
|
depfile = $DEP_FILE
|
||||||
|
deps = gcc
|
||||||
command = $PRE_LINK && /usr/bin/c++ $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD
|
command = $PRE_LINK && /usr/bin/c++ $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD
|
||||||
description = Linking CXX executable $TARGET_FILE
|
description = Linking CXX executable $TARGET_FILE
|
||||||
restat = $RESTAT
|
restat = $RESTAT
|
||||||
|
|
@ -42,7 +74,7 @@ rule CUSTOM_COMMAND
|
||||||
# Rule for re-running cmake.
|
# Rule for re-running cmake.
|
||||||
|
|
||||||
rule RERUN_CMAKE
|
rule RERUN_CMAKE
|
||||||
command = /usr/bin/cmake --regenerate-during-build -S/home/user/saqut -B/home/user/saqut/build
|
command = /usr/bin/cmake --regenerate-during-build -S/home/saqut/Masaüstü/saqutcompiler -B/home/saqut/Masaüstü/saqutcompiler/build
|
||||||
description = Re-running CMake...
|
description = Re-running CMake...
|
||||||
generator = 1
|
generator = 1
|
||||||
|
|
||||||
|
|
@ -51,7 +83,7 @@ rule RERUN_CMAKE
|
||||||
# Rule for re-checking globbed directories.
|
# Rule for re-checking globbed directories.
|
||||||
|
|
||||||
rule VERIFY_GLOBS
|
rule VERIFY_GLOBS
|
||||||
command = /usr/bin/cmake -P /home/user/saqut/build/CMakeFiles/VerifyGlobs.cmake
|
command = /usr/bin/cmake -P /home/saqut/Masaüstü/saqutcompiler/build/CMakeFiles/VerifyGlobs.cmake
|
||||||
description = Re-checking globbed directories...
|
description = Re-checking globbed directories...
|
||||||
generator = 1
|
generator = 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,44 +1,48 @@
|
||||||
# CMake generated Testfile for
|
# CMake generated Testfile for
|
||||||
# Source directory: /home/user/saqut
|
# Source directory: /home/saqut/Masaüstü/saqutcompiler
|
||||||
# Build directory: /home/user/saqut/build
|
# Build directory: /home/saqut/Masaüstü/saqutcompiler/build
|
||||||
#
|
#
|
||||||
# This file includes the relevant testing commands required for
|
# This file includes the relevant testing commands required for
|
||||||
# testing this directory and lists subdirectories to be tested as well.
|
# testing this directory and lists subdirectories to be tested as well.
|
||||||
add_test(unit_tests "bash" "/home/user/saqut/tests/run.sh")
|
add_test(unit_tests "bash" "/home/saqut/Masaüstü/saqutcompiler/tests/run.sh")
|
||||||
set_tests_properties(unit_tests PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;31;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(unit_tests PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;31;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_arithmetic_basic "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/arithmetic/basic.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/arithmetic/basic.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_arithmetic_basic "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/basic.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/basic.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_arithmetic_basic PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_arithmetic_basic PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_arithmetic_precedence "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/arithmetic/precedence.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/arithmetic/precedence.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_arithmetic_compound_mod "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/compound_mod.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/compound_mod.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_arithmetic_precedence PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_arithmetic_compound_mod PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_fibonacci_fib "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/fibonacci/fib.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/fibonacci/fib.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_arithmetic_mod_by_zero_runtime_error "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/mod_by_zero.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/mod_by_zero.runtime_error" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden_error.cmake")
|
||||||
set_tests_properties(golden_fibonacci_fib PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_arithmetic_mod_by_zero_runtime_error PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;109;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_logic_not_operator "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/logic/not_operator.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/logic/not_operator.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_arithmetic_precedence "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/precedence.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/arithmetic/precedence.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_logic_not_operator PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_arithmetic_precedence PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_logic_short_circuit "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/logic/short_circuit.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/logic/short_circuit.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_fibonacci_fib "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/fibonacci/fib.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/fibonacci/fib.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_logic_short_circuit PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_fibonacci_fib PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_loops_basic "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/loops/basic.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/loops/basic.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_logic_not_operator "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/logic/not_operator.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/logic/not_operator.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_loops_basic PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_logic_not_operator PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_loops_do_while_once "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/loops/do_while_once.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/loops/do_while_once.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_logic_short_circuit "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/logic/short_circuit.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/logic/short_circuit.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_loops_do_while_once PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_logic_short_circuit PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_loops_do_while_truthy "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/loops/do_while_truthy.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/loops/do_while_truthy.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_loops_basic "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/basic.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/basic.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_loops_do_while_truthy PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_loops_basic PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_loops_for_break_continue "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/loops/for_break_continue.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/loops/for_break_continue.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_loops_do_while_once "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/do_while_once.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/do_while_once.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_loops_for_break_continue PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_loops_do_while_once PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_loops_nested_break "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/loops/nested_break.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/loops/nested_break.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_loops_do_while_truthy "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/do_while_truthy.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/do_while_truthy.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_loops_nested_break PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_loops_do_while_truthy PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_loops_while_break_continue "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/loops/while_break_continue.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/loops/while_break_continue.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_loops_for_break_continue "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/for_break_continue.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/for_break_continue.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_loops_while_break_continue PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_loops_for_break_continue PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_opt_dce_ir_opt "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/opt/dce.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/opt/dce.ir_opt.expected" "-DCOMMAND=ir" "-DOPTIMIZED=1" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_loops_nested_break "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/nested_break.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/nested_break.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_opt_dce_ir_opt PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;64;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_loops_nested_break PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_opt_folding_ir_opt "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/opt/folding.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/opt/folding.ir_opt.expected" "-DCOMMAND=ir" "-DOPTIMIZED=1" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_loops_while_break_continue "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/while_break_continue.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/loops/while_break_continue.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_opt_folding_ir_opt PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;64;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_loops_while_break_continue PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_opt_run_opt "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/opt/run_opt.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/opt/run_opt.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_opt_dce_ir_opt "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/dce.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/dce.ir_opt.expected" "-DCOMMAND=ir" "-DOPTIMIZED=1" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_opt_run_opt PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_opt_dce_ir_opt PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;64;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_opt_run_opt_run_opt "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/opt/run_opt.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/opt/run_opt.run_opt.expected" "-DOPTIMIZED=1" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_opt_folding_ir_opt "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/folding.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/folding.ir_opt.expected" "-DCOMMAND=ir" "-DOPTIMIZED=1" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_opt_run_opt_run_opt PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;80;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_opt_folding_ir_opt PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;64;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_string_equality "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/string/equality.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/string/equality.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_opt_run_opt "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/run_opt.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/run_opt.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_string_equality PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_opt_run_opt PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_string_hello "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/string/hello.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/string/hello.expected" "-P" "/home/user/saqut/cmake/run_golden.cmake")
|
add_test(golden_opt_run_opt_run_opt "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/run_opt.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/opt/run_opt.run_opt.expected" "-DOPTIMIZED=1" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_string_hello PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;51;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_opt_run_opt_run_opt PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;80;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
add_test(golden_string_ordering_error_compile_error "/usr/bin/cmake" "-DBINARY=/home/user/saqut/build/saqut" "-DSOURCE=/home/user/saqut/tests/golden/string/ordering_error.sqt" "-DEXPECTED=/home/user/saqut/tests/golden/string/ordering_error.compile_error" "-P" "/home/user/saqut/cmake/run_golden_error.cmake")
|
add_test(golden_string_equality "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/string/equality.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/string/equality.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
set_tests_properties(golden_string_ordering_error_compile_error PROPERTIES _BACKTRACE_TRIPLES "/home/user/saqut/CMakeLists.txt;95;add_test;/home/user/saqut/CMakeLists.txt;0;")
|
set_tests_properties(golden_string_equality PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
|
add_test(golden_string_hello "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/string/hello.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/string/hello.expected" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden.cmake")
|
||||||
|
set_tests_properties(golden_string_hello PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;51;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
|
add_test(golden_string_ordering_error_compile_error "/usr/bin/cmake" "-DBINARY=/home/saqut/Masaüstü/saqutcompiler/build/saqut" "-DSOURCE=/home/saqut/Masaüstü/saqutcompiler/tests/golden/string/ordering_error.sqt" "-DEXPECTED=/home/saqut/Masaüstü/saqutcompiler/tests/golden/string/ordering_error.compile_error" "-P" "/home/saqut/Masaüstü/saqutcompiler/cmake/run_golden_error.cmake")
|
||||||
|
set_tests_properties(golden_string_ordering_error_compile_error PROPERTIES _BACKTRACE_TRIPLES "/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;95;add_test;/home/saqut/Masaüstü/saqutcompiler/CMakeLists.txt;0;")
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
# Install script for directory: /home/user/saqut
|
# Install script for directory: /home/saqut/Masaüstü/saqutcompiler
|
||||||
|
|
||||||
# Set the install prefix
|
# Set the install prefix
|
||||||
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||||
|
|
@ -29,7 +29,7 @@ endif()
|
||||||
|
|
||||||
# Install shared libraries without execute permission?
|
# Install shared libraries without execute permission?
|
||||||
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
||||||
set(CMAKE_INSTALL_SO_NO_EXE "1")
|
set(CMAKE_INSTALL_SO_NO_EXE "0")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Is this installation the result of a crosscompile?
|
# Is this installation the result of a crosscompile?
|
||||||
|
|
@ -37,18 +37,30 @@ if(NOT DEFINED CMAKE_CROSSCOMPILING)
|
||||||
set(CMAKE_CROSSCOMPILING "FALSE")
|
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set default install directory permissions.
|
# Set path to fallback-tool for dependency-resolution.
|
||||||
if(NOT DEFINED CMAKE_OBJDUMP)
|
if(NOT DEFINED CMAKE_OBJDUMP)
|
||||||
set(CMAKE_OBJDUMP "/usr/bin/objdump")
|
set(CMAKE_OBJDUMP "/usr/bin/objdump")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
|
||||||
|
"${CMAKE_INSTALL_MANIFEST_FILES}")
|
||||||
|
if(CMAKE_INSTALL_LOCAL_ONLY)
|
||||||
|
file(WRITE "/home/saqut/Masaüstü/saqutcompiler/build/install_local_manifest.txt"
|
||||||
|
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
|
||||||
|
endif()
|
||||||
if(CMAKE_INSTALL_COMPONENT)
|
if(CMAKE_INSTALL_COMPONENT)
|
||||||
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
|
if(CMAKE_INSTALL_COMPONENT MATCHES "^[a-zA-Z0-9_.+-]+$")
|
||||||
|
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
|
||||||
|
else()
|
||||||
|
string(MD5 CMAKE_INST_COMP_HASH "${CMAKE_INSTALL_COMPONENT}")
|
||||||
|
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INST_COMP_HASH}.txt")
|
||||||
|
unset(CMAKE_INST_COMP_HASH)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
|
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
|
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
|
||||||
"${CMAKE_INSTALL_MANIFEST_FILES}")
|
file(WRITE "/home/saqut/Masaüstü/saqutcompiler/build/${CMAKE_INSTALL_MANIFEST}"
|
||||||
file(WRITE "/home/user/saqut/build/${CMAKE_INSTALL_MANIFEST}"
|
|
||||||
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
|
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
|
||||||
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,12 @@
|
||||||
#include "parser/nodes/declarations.hpp"
|
#include "parser/nodes/declarations.hpp"
|
||||||
#include "parser/nodes/expressions.hpp"
|
#include "parser/nodes/expressions.hpp"
|
||||||
#include "parser/nodes/program.hpp"
|
#include "parser/nodes/program.hpp"
|
||||||
|
#include "diagnostic/diagnostic_engine.hpp"
|
||||||
|
|
||||||
class DeadCodeElimPass : public OptimizationPass {
|
class DeadCodeElimPass : public OptimizationPass {
|
||||||
public:
|
public:
|
||||||
|
explicit DeadCodeElimPass(DiagnosticEngine& diag) : diag_(diag) {}
|
||||||
|
|
||||||
bool run(ASTNode* root, SymbolTable*) override {
|
bool run(ASTNode* root, SymbolTable*) override {
|
||||||
changed_ = false;
|
changed_ = false;
|
||||||
visit(root);
|
visit(root);
|
||||||
|
|
@ -30,6 +33,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
DiagnosticEngine& diag_;
|
||||||
bool changed_ = false;
|
bool changed_ = false;
|
||||||
|
|
||||||
void visit(ASTNode* node) {
|
void visit(ASTNode* node) {
|
||||||
|
|
@ -45,11 +49,12 @@ private:
|
||||||
|
|
||||||
for (auto* child : ch) {
|
for (auto* child : ch) {
|
||||||
if (term) {
|
if (term) {
|
||||||
// Bu deyim erişilemez
|
|
||||||
if (auto* sn = dynamic_cast<StatementNode*>(child)) {
|
if (auto* sn = dynamic_cast<StatementNode*>(child)) {
|
||||||
if (sn->isReachable) {
|
if (sn->isReachable) {
|
||||||
sn->isReachable = false;
|
sn->isReachable = false;
|
||||||
changed_ = true;
|
changed_ = true;
|
||||||
|
diag_.report("W003", sn->loc,
|
||||||
|
"Bu kod hiçbir zaman çalışmaz (return/break/continue sonrası)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -59,12 +64,14 @@ private:
|
||||||
term = true;
|
term = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Erişilemez çocukları sil ve vektörden çıkar
|
// remove_if erişilemez düğümleri sona taşır (silmez), sonra delete
|
||||||
ch.erase(std::remove_if(ch.begin(), ch.end(),
|
auto toErase = std::remove_if(ch.begin(), ch.end(),
|
||||||
[](ASTNode* n) {
|
[](ASTNode* n) {
|
||||||
auto* sn = dynamic_cast<StatementNode*>(n);
|
auto* sn = dynamic_cast<StatementNode*>(n);
|
||||||
return sn && !sn->isReachable;
|
return sn && !sn->isReachable;
|
||||||
}), ch.end());
|
});
|
||||||
|
for (auto it = toErase; it != ch.end(); ++it) delete *it;
|
||||||
|
ch.erase(toErase, ch.end());
|
||||||
|
|
||||||
// Alt bloklara da in
|
// Alt bloklara da in
|
||||||
for (auto* child : ch) visit(child);
|
for (auto* child : ch) visit(child);
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public:
|
||||||
if (cfg.optConstantFolding)
|
if (cfg.optConstantFolding)
|
||||||
passes_.push_back(std::make_unique<ConstantFoldingPass>(diag));
|
passes_.push_back(std::make_unique<ConstantFoldingPass>(diag));
|
||||||
if (cfg.optDeadCodeElim)
|
if (cfg.optDeadCodeElim)
|
||||||
passes_.push_back(std::make_unique<DeadCodeElimPass>());
|
passes_.push_back(std::make_unique<DeadCodeElimPass>(diag));
|
||||||
maxRounds_ = cfg.maxFixpointRounds;
|
maxRounds_ = cfg.maxFixpointRounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -236,10 +236,12 @@ public:
|
||||||
// KARMAŞIKLIK: O(1) — referans döndürür
|
// KARMAŞIKLIK: O(1) — referans döndürür
|
||||||
std::vector<ASTNode*>& getChildren() { return children; }
|
std::vector<ASTNode*>& getChildren() { return children; }
|
||||||
|
|
||||||
// ~ASTNode() — Sanal yıkıcı (polimorfik silme için)
|
// ~ASTNode() — children vektörünü özyinelemeli siler.
|
||||||
// delete ASTNode* yapıldığında doğru alt sınıf yıkıcısı çağrılır.
|
// Typed pointer'lar (condition, thenBranch vb.) alt sınıf yıkıcılarına bırakılır;
|
||||||
// Bu olmazsa türetilmiş sınıfların kaynakları sızdırılır.
|
// children vektörü ile typed pointer'lar örtüşmediği için double-delete olmaz.
|
||||||
virtual ~ASTNode() = default;
|
virtual ~ASTNode() {
|
||||||
|
for (auto* ch : children) delete ch;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// children — Alt düğümlerin vektörü.
|
// children — Alt düğümlerin vektörü.
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ public:
|
||||||
ASTNode* Right = nullptr;
|
ASTNode* Right = nullptr;
|
||||||
|
|
||||||
BinaryExpressionNode();
|
BinaryExpressionNode();
|
||||||
|
~BinaryExpressionNode() override { delete Left; delete Right; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
// FunctionDeclNode
|
// FunctionDeclNode
|
||||||
FunctionDeclNode::FunctionDeclNode() { kind = ASTKind::FunctionDecl; }
|
FunctionDeclNode::FunctionDeclNode() { kind = ASTKind::FunctionDecl; }
|
||||||
|
FunctionDeclNode::~FunctionDeclNode() { for (auto* p : params) delete p; }
|
||||||
void FunctionDeclNode::log(int indent) {
|
void FunctionDeclNode::log(int indent) {
|
||||||
std::cout << jsonIndent(indent) << "FunctionDecl (" << name << " : " << returnType << ")\n";
|
std::cout << jsonIndent(indent) << "FunctionDecl (" << name << " : " << returnType << ")\n";
|
||||||
for (auto* child : children) child->log(indent + 1);
|
for (auto* child : children) child->log(indent + 1);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ public:
|
||||||
std::string returnType;
|
std::string returnType;
|
||||||
std::vector<VariableDeclNode*> params; // TODO(faz2): parametreler
|
std::vector<VariableDeclNode*> params; // TODO(faz2): parametreler
|
||||||
FunctionDeclNode();
|
FunctionDeclNode();
|
||||||
|
~FunctionDeclNode() override;
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
@ -21,6 +22,7 @@ public:
|
||||||
std::string name;
|
std::string name;
|
||||||
ASTNode* initExpr = nullptr;
|
ASTNode* initExpr = nullptr;
|
||||||
VariableDeclNode();
|
VariableDeclNode();
|
||||||
|
~VariableDeclNode() override { delete initExpr; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ public:
|
||||||
ASTNode* operand = nullptr;
|
ASTNode* operand = nullptr;
|
||||||
TokenType Operator;
|
TokenType Operator;
|
||||||
PostfixNode();
|
PostfixNode();
|
||||||
|
~PostfixNode() override { delete operand; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
@ -17,6 +18,7 @@ public:
|
||||||
ASTNode* callee = nullptr;
|
ASTNode* callee = nullptr;
|
||||||
std::vector<ASTNode*> arguments;
|
std::vector<ASTNode*> arguments;
|
||||||
CallExpressionNode();
|
CallExpressionNode();
|
||||||
|
~CallExpressionNode() override { delete callee; for (auto* a : arguments) delete a; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
@ -27,6 +29,7 @@ public:
|
||||||
std::string member;
|
std::string member;
|
||||||
bool arrow = false;
|
bool arrow = false;
|
||||||
MemberAccessNode();
|
MemberAccessNode();
|
||||||
|
~MemberAccessNode() override { delete object; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
@ -36,6 +39,7 @@ public:
|
||||||
ASTNode* object = nullptr;
|
ASTNode* object = nullptr;
|
||||||
ASTNode* index = nullptr;
|
ASTNode* index = nullptr;
|
||||||
IndexExpressionNode();
|
IndexExpressionNode();
|
||||||
|
~IndexExpressionNode() override { delete object; delete index; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ public:
|
||||||
ASTNode* thenBranch = nullptr;
|
ASTNode* thenBranch = nullptr;
|
||||||
ASTNode* elseBranch = nullptr;
|
ASTNode* elseBranch = nullptr;
|
||||||
IfStatementNode();
|
IfStatementNode();
|
||||||
|
~IfStatementNode() override { delete condition; delete thenBranch; delete elseBranch; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
@ -25,6 +26,7 @@ public:
|
||||||
ASTNode* condition = nullptr;
|
ASTNode* condition = nullptr;
|
||||||
ASTNode* body = nullptr;
|
ASTNode* body = nullptr;
|
||||||
WhileStatementNode();
|
WhileStatementNode();
|
||||||
|
~WhileStatementNode() override { delete condition; delete body; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
@ -36,6 +38,7 @@ public:
|
||||||
ASTNode* update = nullptr;
|
ASTNode* update = nullptr;
|
||||||
ASTNode* body = nullptr;
|
ASTNode* body = nullptr;
|
||||||
ForStatementNode();
|
ForStatementNode();
|
||||||
|
~ForStatementNode() override { delete init; delete condition; delete update; delete body; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
@ -45,6 +48,7 @@ public:
|
||||||
ASTNode* condition = nullptr;
|
ASTNode* condition = nullptr;
|
||||||
ASTNode* body = nullptr;
|
ASTNode* body = nullptr;
|
||||||
DoWhileStatementNode();
|
DoWhileStatementNode();
|
||||||
|
~DoWhileStatementNode() override { delete body; delete condition; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
@ -53,6 +57,7 @@ class ReturnStatementNode : public StatementNode {
|
||||||
public:
|
public:
|
||||||
ASTNode* value = nullptr;
|
ASTNode* value = nullptr;
|
||||||
ReturnStatementNode();
|
ReturnStatementNode();
|
||||||
|
~ReturnStatementNode() override { delete value; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
@ -75,6 +80,7 @@ class ExpressionStatementNode : public StatementNode {
|
||||||
public:
|
public:
|
||||||
ASTNode* expression = nullptr;
|
ASTNode* expression = nullptr;
|
||||||
ExpressionStatementNode();
|
ExpressionStatementNode();
|
||||||
|
~ExpressionStatementNode() override { delete expression; }
|
||||||
void log(int indent = 0) override;
|
void log(int indent = 0) override;
|
||||||
std::string toJson(int depth = 0) override;
|
std::string toJson(int depth = 0) override;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue