changeset 454:214272c8f2da

inline continue...
author kono
date Tue, 30 Nov 2004 02:30:20 +0900
parents 1e5ca85d3f97
children 563a5d29ec5e
files mc-codegen.c mc-parse.c mc-parse.h
diffstat 3 files changed, 19 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mc-codegen.c	Tue Nov 30 02:20:42 2004 +0900
+++ b/mc-codegen.c	Tue Nov 30 02:30:20 2004 +0900
@@ -6,6 +6,7 @@
 #include "mc-parse.h"
 #include "mc-codegen.h"
 #include "mc-code.h"
+#include "mc-switch.h"
 #include "mc-inline.h"
 
 int use;       /* generated value will be used */
@@ -63,7 +64,7 @@
 static void st_while(int e1);
 static void st_for(int e1);
 static void st_switch(int e1);
-static void st_compj(int e1);
+static void st_comp(int e1);
 static void st_break(int e1);
 static void st_continue(int e1);
 static void st_case(int e1);
@@ -4199,10 +4200,9 @@
 
 static void
 st_decl(int e1){
-    NMTBL *n = (NTMBL *)caddr(e1);
-    int stmode = cadddr(e1);
+    NMTBL *n = (NMTBL *)caddr(e1);
+    // int stmode = cadddr(e1);
 }
-
  
 static void
 st_if(int e1){
@@ -4285,9 +4285,8 @@
 static void
 st_for(int e1){
     int p0,p1,p2,body;
-    int l,e,dflag=0;
+    int l,e;
     int sbreak=blabel;
-    int slimit = lfree_type_limit;
     int scontinue=clabel;
 
     e = caddr(e1); 
@@ -4449,7 +4448,7 @@
  
 static void
 st_return(int e1){
-    int e,e1;
+    int e;
 
     if (!cslabel) gen_jmp(cslabel = fwdlabel());
     if(!(e=caddr(e1))) {
--- a/mc-parse.c	Tue Nov 30 02:20:42 2004 +0900
+++ b/mc-parse.c	Tue Nov 30 02:30:20 2004 +0900
@@ -76,7 +76,7 @@
 
 struct {int fd,ln;char *name0;int inc;FILE *fcb;} *filep,filestack[FILES];
 
-static NMTBL *decl0(void),*decl1(void),*l_top_search(char *name,int sc);
+static NMTBL *decl0(void),*decl1(void);
 static int append3(int p,int a1,int a2);
 static int expr0(void);
 static int expr1(void);
@@ -169,8 +169,8 @@
 
 static int ac,ac2;
 static char **av;
-static int cslist;
-static int clabel;
+int cslist;
+int clabel;
 static int ilabel;
 static int stat_no;
 
@@ -2176,7 +2176,7 @@
 
 #if CASE_CODE
 /* used in insert ascend */
-static int
+extern int
 docase_eq()
 {
     error(-1);  // duplicate case value
@@ -2431,7 +2431,7 @@
 	    parse = list3(ST_LABEL,parse,(int)nptr);
 	else
 	    fwddef(nptr->dsp);
-    } else if(nptr->sc != EMPTY && nptr->sc != EXTRN1)
+    } else if(nptr->sc != EMPTY && nptr->sc != EXTRN1) {
 	error(TYERR);
     } else {
 	nptr->sc=EMPTY;
@@ -4033,7 +4033,7 @@
 }
 
 // search top level local name (for label)
-static NMTBL *
+extern NMTBL *
 l_top_search(char *name,int sc)
 {
     NMTBL *nlist,*nptr1;
--- a/mc-parse.h	Tue Nov 30 02:20:42 2004 +0900
+++ b/mc-parse.h	Tue Nov 30 02:30:20 2004 +0900
@@ -5,12 +5,15 @@
 extern int mode;            /* grammer mode (STAT,ADECL) */
 extern int stmode;          /* storage mode (STATIC,EXTRN) */
 extern int ctmode;          /* constant mode */
+extern int inmode;          /* inline mode */
 extern int labelno;         /* label number */
 extern int gpc;             /* global variable size (unused?) */
 extern int disp;            /* local variable offset */
 extern int args;            /* function arguments */
 extern int init_vars;       /* variable initialize list in local decl */
 extern int cslabel;         /* case label */
+extern int cslist;          /* case list */
+extern int clabel;          /* continue label */
 extern int control;         /* control is reached */
 extern NMTBL *nptr;         /* current name table */
 extern NMTBL *gnptr;        /* currrent global name table (unsed?) */
@@ -150,5 +153,9 @@
 extern void save_cheap(struct cheap *scheap,struct cheap *cheap);
 extern struct cheap * reset_cheap(struct cheap *scheap);
 extern void pfdecl(NMTBL *nptr);
+#if CASE_CODE
+extern int docase_eq();
+#endif
+extern NMTBL *l_top_search(char *name,int sc);
 
 /* end */