scc

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

commit 67f3a8cc5d3362bd2f4670721de588a266fbb1cc
parent 4858c0d0e802307875e8fe191a52946f05f7907d
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 25 Mar 2014 08:04:53 +0100

Remove tree.c

This file is not going to be used anymore

Diffstat:
MMakefile | 2+-
Dtree.c | 37-------------------------------------
2 files changed, 1 insertion(+), 38 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,6 +1,6 @@ OBJS = types.o decl.o lex.o error.o symbol.o main.o expr.o \ - wrapper.o tree.o + wrapper.o all: kcc diff --git a/tree.c b/tree.c @@ -1,37 +0,0 @@ - -#include <assert.h> -#include <stdint.h> -#include <stdio.h> - -#include "cc.h" -#include "syntax.h" -#include "symbol.h" - -struct node { - unsigned char op; - union value u; - struct ctype *type; - struct node *left; - struct node *right; -}; - -struct node * -node(unsigned char op, struct node *l, struct node *r) -{ - register struct node *np = xmalloc(sizeof(*np)); - - np->op = op; - np->left = l; - np->right = r; - - return np; -} - -bool -walk(register struct node *np, bool (*fun)(struct node *)) -{ - if (!np) - return 1; - - return (*fun)(np) && walk(np->left, fun) && walk(np->right, fun); -}