Merge pull request #16 from birth-software/more-peephole

More peephole (rewrite -> simple chapter 09)
This commit is contained in:
David 2024-07-14 20:45:49 +02:00 committed by GitHub
commit 877690bd55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 2056 additions and 1366 deletions

File diff suppressed because it is too large Load Diff

View File

@ -12,9 +12,9 @@ function compile()
compile_command="clang++ -o $build_dir/$exe_name $debug_info $optimizations -std=gnu++20 -Wall -Wextra -Wpedantic -Wno-nested-anon-types -pedantic -fno-exceptions -fno-stack-protector -ferror-limit=1 -MJ $build_dir/compile_commands.json"
case "$OSTYPE" in
darwin*) ;;
linux*) compile_command="$compile_command -ffreestanding -nostdlib -static bootstrap/entry.S" ;;
*) echo "unknown: $OSTYPE" ;;
darwin*) compile_command="$compile_command -DDEMAND_LIBC=1";;
linux*) compile_command="$compile_command -ffreestanding -nostdlib -static bootstrap/entry.S -DDEMAND_LIBC=0" ;;
*) echo "Unknown operating system $OSTYPE: no specific flags were added" ;;
esac
compile_command="$compile_command bootstrap/main.cpp"

View File

@ -2,5 +2,9 @@
set -e
source ./compile.sh
compile "build" "nest" "-g" "";
build_dir="build"
exe_name="nest"
exe_path=$build_dir/$exe_name
compile $build_dir $exe_name "-g" "";
build/nest

View File

@ -74,6 +74,7 @@ fn if4(arg: s32) s32
fn if5(arg: s32) s32
{
>a: s32 = 1;
if (arg == 1)
{
if (arg == 2)