scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 408fe0b905d854c979a98e9600f5671b7001f008
parent 9249ec504ef9f7062c6caac4bc75e35d83039e1a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 10 Dec 2024 09:02:14 +0100

cc2: Move peephole to arch code

The peephole optimizations are by definition machine dependant
and for that reason it has to be moved out of the generic code.

Diffstat:
Msrc/cmd/scc-cc/cc2/Makefile | 7+++----
Msrc/cmd/scc-cc/cc2/amd64-sysv/Makefile | 3++-
Asrc/cmd/scc-cc/cc2/amd64-sysv/peep.c | 7+++++++
Asrc/cmd/scc-cc/cc2/arm64-sysv/peep.c | 8++++++++
Msrc/cmd/scc-cc/cc2/i386-sysv/Makefile | 3++-
Asrc/cmd/scc-cc/cc2/i386-sysv/peep.c | 8++++++++
Dsrc/cmd/scc-cc/cc2/peep.c | 7-------
Msrc/cmd/scc-cc/cc2/qbe/Makefile | 3++-
Asrc/cmd/scc-cc/cc2/qbe/peep.c | 8++++++++
Msrc/cmd/scc-cc/cc2/z80-scc/Makefile | 3++-
Asrc/cmd/scc-cc/cc2/z80-scc/peep.c | 9+++++++++
11 files changed, 51 insertions(+), 15 deletions(-)

diff --git a/src/cmd/scc-cc/cc2/Makefile b/src/cmd/scc-cc/cc2/Makefile @@ -15,13 +15,12 @@ include $(PROJECTDIR)/scripts/rules.mk MORE_LDLIBS = -lscc OBJS =\ + code.o\ main.o\ - parser.o\ - peep.o\ - symbol.o\ node.o\ - code.o\ optm.o\ + parser.o\ + symbol.o\ TARGET =\ cc2-amd64-sysv\ diff --git a/src/cmd/scc-cc/cc2/amd64-sysv/Makefile b/src/cmd/scc-cc/cc2/amd64-sysv/Makefile @@ -6,8 +6,9 @@ include $(PROJECTDIR)/scripts/rules.mk OBJS =\ cgen.o \ - optm.o \ code.o \ + optm.o \ + peep.o \ types.o \ all: builtin.o diff --git a/src/cmd/scc-cc/cc2/amd64-sysv/peep.c b/src/cmd/scc-cc/cc2/amd64-sysv/peep.c @@ -0,0 +1,7 @@ +#include <scc/scc.h> +#include "../cc2.h" + +void +peephole(void) +{ +} diff --git a/src/cmd/scc-cc/cc2/arm64-sysv/peep.c b/src/cmd/scc-cc/cc2/arm64-sysv/peep.c @@ -0,0 +1,7 @@ +#include <scc/scc.h> +#include "../cc2.h" + +void +peephole(void) +{ +} +\ No newline at end of file diff --git a/src/cmd/scc-cc/cc2/i386-sysv/Makefile b/src/cmd/scc-cc/cc2/i386-sysv/Makefile @@ -6,8 +6,9 @@ include $(PROJECTDIR)/scripts/rules.mk OBJS =\ cgen.o \ - optm.o \ code.o \ + optm.o \ + peep.o \ types.o \ all: builtin.o diff --git a/src/cmd/scc-cc/cc2/i386-sysv/peep.c b/src/cmd/scc-cc/cc2/i386-sysv/peep.c @@ -0,0 +1,7 @@ +#include <scc/scc.h> +#include "../cc2.h" + +void +peephole(void) +{ +} +\ No newline at end of file diff --git a/src/cmd/scc-cc/cc2/peep.c b/src/cmd/scc-cc/cc2/peep.c @@ -1,7 +0,0 @@ -#include <scc/scc.h> -#include "cc2.h" - -void -peephole(void) -{ -} diff --git a/src/cmd/scc-cc/cc2/qbe/Makefile b/src/cmd/scc-cc/cc2/qbe/Makefile @@ -6,8 +6,9 @@ include $(PROJECTDIR)/scripts/rules.mk OBJS =\ cgen.o \ - optm.o \ code.o \ + optm.o \ + peep.o \ all: builtin.o diff --git a/src/cmd/scc-cc/cc2/qbe/peep.c b/src/cmd/scc-cc/cc2/qbe/peep.c @@ -0,0 +1,7 @@ +#include <scc/scc.h> +#include "../cc2.h" + +void +peephole(void) +{ +} +\ No newline at end of file diff --git a/src/cmd/scc-cc/cc2/z80-scc/Makefile b/src/cmd/scc-cc/cc2/z80-scc/Makefile @@ -6,8 +6,9 @@ include $(PROJECTDIR)/scripts/rules.mk OBJS =\ cgen.o \ - optm.o \ code.o \ + optm.o \ + peep.o \ types.o \ all: builtin.o diff --git a/src/cmd/scc-cc/cc2/z80-scc/peep.c b/src/cmd/scc-cc/cc2/z80-scc/peep.c @@ -0,0 +1,9 @@ +#include <scc/scc.h> + +#include "../cc2.h" +#include "arch.h" + +void +peephole(void) +{ +}