changeset 605:1078c7e3bfb0

minor fixes
author kono
date Mon, 30 Jan 2006 18:36:47 +0900
parents ff033b46cac5
children 1e29742ea9a6
files mc-code-arm.c mc-code-ia32.c mc-code-mips.c mc-code-powerpc.c mc-codegen.c mc-parse.c
diffstat 6 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mc-code-arm.c	Mon Jan 30 13:42:12 2006 +0900
+++ b/mc-code-arm.c	Mon Jan 30 18:36:47 2006 +0900
@@ -33,6 +33,7 @@
 #define __SIZE_TYPE__ int\n\
 #define __attribute__(a)\n\
 #define __flexarr\n\
+#define __ARM_ARCH_4__\n\
 #define __WCHAR_TYPE__ int\n\
 #define __alignof__(type) (sizeof(type)==1?1:sizeof(type)==2?2:sizeof(type)<=4?4:8)\n\
 #define __PTRDIFF_TYPE__ int\n\
@@ -567,6 +568,7 @@
 {
     /* called for each file */
     init_ptr_cache();
+    output_mode = -1;
 }
 
 
@@ -3185,7 +3187,7 @@
     /* this is called once per file */
     printf("@ Generated by mc for ARM/elf\n");
     printf("\t.file \"%s\"\n",filename);
-    printf(".text\n");
+    // printf(".text\n");
 }
 
 // should have pcond_const
--- a/mc-code-ia32.c	Mon Jan 30 13:42:12 2006 +0900
+++ b/mc-code-ia32.c	Mon Jan 30 18:36:47 2006 +0900
@@ -479,6 +479,7 @@
 emit_reinit()
 {
     /* called for each file */
+    output_mode = -1;
 }
 
 
@@ -1790,7 +1791,7 @@
     printf("\t.file \"%s\"\n",filename);
     printf("\t.version\t\"01.01\"\n");
     /* printf("gcc2_compiled.:\n"); */
-    printf(".text\n");
+    // printf(".text\n");
 }
 
 void
--- a/mc-code-mips.c	Mon Jan 30 13:42:12 2006 +0900
+++ b/mc-code-mips.c	Mon Jan 30 18:36:47 2006 +0900
@@ -514,6 +514,7 @@
 {
     /* called for each file */
     init_ptr_cache();
+    output_mode = -1;
 }
 
 
@@ -2745,7 +2746,7 @@
     /* this is called once per file */
     printf("\t.file %d \"%s\"\n",count++,filename);
     printf(".abicalls\n");
-    printf(".text\n");
+    // printf(".text\n");
 
     if (asi) {
         fclose(asi);
--- a/mc-code-powerpc.c	Mon Jan 30 13:42:12 2006 +0900
+++ b/mc-code-powerpc.c	Mon Jan 30 18:36:47 2006 +0900
@@ -460,6 +460,7 @@
 {
     /* called for each file */
     /* heap is initialized here, setup ptr cache free list */
+    output_mode = -1;
     init_ptr_cache();
 }
 
@@ -2672,7 +2673,7 @@
     printf("\t.file \"%s\"\n",filename);
     /* printf("\t.version\t\"01.01\"\n"); */
     /* printf("gcc2_compiled.:\n"); */
-    printf(".text\n");
+    // printf(".text\n");
 }
 
 #define CRBITSIZ 4
--- a/mc-codegen.c	Mon Jan 30 13:42:12 2006 +0900
+++ b/mc-codegen.c	Mon Jan 30 18:36:47 2006 +0900
@@ -2969,9 +2969,9 @@
 		n = lsearch(n->nm,0);
 	    } else error(RDERR);
 	  } else {
-	    if (mode==GDECL)
+	    if (mode==GDECL) {
 		compatible(n->ty,type);
-	    else
+	    } else
 		error(RDERR); // on different type
 	  }
 	}
--- a/mc-parse.c	Mon Jan 30 13:42:12 2006 +0900
+++ b/mc-parse.c	Mon Jan 30 18:36:47 2006 +0900
@@ -1813,6 +1813,10 @@
 {
     int t,arglist;
 
+    if (stmode==0 && n->sc==STATIC) {
+	// static proto type, no storage class in definition
+	stmode=n->sc;
+    }
     if(!chk) gen_code_enter(n->nm);
     if (inmode) error(ILERR);
     extrn_use(n);
@@ -1900,6 +1904,10 @@
     int sd = stypedecl;
     int arglist,arg_disp;
     if (!inmode) {
+	if (stmode==0 && n->sc==STATIC) {
+	    // static proto type, no storage class in definition
+	    stmode=n->sc;
+	}
 	if(!chk) gen_enter(n->nm);
 	extrn_use(n);
 	retlabel=fwdlabel();