Mercurial > hg > CbC > old > DPP
changeset 1:2874954d97b2
Fix dpp for cbc using LLVM 3.7
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 16 Dec 2015 16:52:16 +0900 |
parents | d4bc23cb728b |
children | b15128ab0324 |
files | .hgignore Makefile dpp.cbc dpp.h |
diffstat | 4 files changed, 23 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Wed Dec 16 15:16:11 2015 +0900 +++ b/.hgignore Wed Dec 16 16:52:16 2015 +0900 @@ -2,3 +2,6 @@ CVS* *.swp *.o +*.s + +dpp
--- a/Makefile Wed Dec 16 15:16:11 2015 +0900 +++ b/Makefile Wed Dec 16 16:52:16 2015 +0900 @@ -1,7 +1,7 @@ -CC=gcc -MCC=mcc +CC=clang +MCC=cbc-clang TARGET=dpp dpp2 tableau tableau2 tableau3 -MCCFLAGS=-s +MCCFLAGS=-S CFLAGS=-I. -g -Wall .SUFFIXES: .cbc .c .o @@ -20,7 +20,7 @@ dpp2: dpp2.o queue.o scheduler.o memory.o crc32.o $(CC) $(CFLAGS) -o $@ $^ -# tableau expansion +# tableau expansion tableau: dpp2.o queue.o tableau.o memory.o state_db.o crc32.o $(CC) $(CFLAGS) -o $@ $^
--- a/dpp.cbc Wed Dec 16 15:16:11 2015 +0900 +++ b/dpp.cbc Wed Dec 16 16:52:16 2015 +0900 @@ -6,41 +6,41 @@ #include "dpp.h" -code putdown_lfork(PhilsPtr self) +__code putdown_lfork(PhilsPtr self) { printf("%d: putdown_lfork:%d\n", self->id, self->left_fork->id); self->left_fork->owner = NULL; goto thinking(self); } -code putdown_rfork(PhilsPtr self) +__code putdown_rfork(PhilsPtr self) { printf("%d: putdown_rfork:%d\n", self->id, self->right_fork->id); self->right_fork->owner = NULL; goto putdown_lfork(self); } -code eating(PhilsPtr self) +__code eating(PhilsPtr self) { printf("%d: eating\n", self->id); goto putdown_rfork(self); } /* waiting for right fork */ -code hungry2(PhilsPtr self) +__code hungry2(PhilsPtr self) { printf("%d: hungry2\n", self->id); goto pickup_rfork(self); } /* waiting for left fork */ -code hungry1(PhilsPtr self) +__code hungry1(PhilsPtr self) { printf("%d: hungry1\n", self->id); goto pickup_lfork(self); } -code pickup_rfork(PhilsPtr self) +__code pickup_rfork(PhilsPtr self) { if (self->right_fork->owner == NULL) { printf("%d: pickup_rfork:%d\n", self->id, self->right_fork->id); @@ -51,7 +51,7 @@ } } -code pickup_lfork(PhilsPtr self) +__code pickup_lfork(PhilsPtr self) { if (self->left_fork->owner == NULL) { printf("%d: pickup_lfork:%d\n", self->id, self->left_fork->id); @@ -62,7 +62,7 @@ } } -code thinking(PhilsPtr self) +__code thinking(PhilsPtr self) { printf("%d: thinking\n", self->id); goto hungry1(self);
--- a/dpp.h Wed Dec 16 15:16:11 2015 +0900 +++ b/dpp.h Wed Dec 16 16:52:16 2015 +0900 @@ -4,13 +4,13 @@ #include "dpp_common.h" -extern code putdown_lfork(PhilsPtr self); -extern code putdown_rfork(PhilsPtr self); -extern code eating(PhilsPtr self); -extern code hungry2(PhilsPtr self); -extern code hungry1(PhilsPtr self); -extern code pickup_rfork(PhilsPtr self); -extern code pickup_lfork(PhilsPtr self); -extern code thinking(PhilsPtr self); +extern __code putdown_lfork(PhilsPtr self); +extern __code putdown_rfork(PhilsPtr self); +extern __code eating(PhilsPtr self); +extern __code hungry2(PhilsPtr self); +extern __code hungry1(PhilsPtr self); +extern __code pickup_rfork(PhilsPtr self); +extern __code pickup_lfork(PhilsPtr self); +extern __code thinking(PhilsPtr self); #endif