shithub: scc

Download patch

ref: 67f3a8cc5d3362bd2f4670721de588a266fbb1cc
parent: 4858c0d0e802307875e8fe191a52946f05f7907d
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Mar 25 04:04:53 EDT 2014

Remove tree.c

This file is not going to be used anymore

--- 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
 
--- a/tree.c
+++ /dev/null
@@ -1,37 +1,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);
-}