* src/pic16/glue.c (pic16emitStaticSeg): do not print as publics or
authorvrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 27 May 2004 22:19:52 +0000 (22:19 +0000)
committervrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 27 May 2004 22:19:52 +0000 (22:19 +0000)
externs configuration variables,
* src/pic16/ralloc.h,
* src/pic16/ralloc.cc: IS_CONFIG_ADDRESS is made public and added
prototype in header, commented out some debug messages

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3330 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/pic16/device.c
src/pic16/glue.c
src/pic16/ralloc.c
src/pic16/ralloc.h

index ce68e5c88ebcfa0d3993effa0c408ab4a9db4a5c..60bb9d11e7ad4b56335c02fa08dadc99e02446ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-05-28 Vangelis Rokas <vrokas AT otenet.gr>
+
+       * src/pic16/glue.c (pic16emitStaticSeg): do not print as publics or
+       externs configuration variables,
+       * src/pic16/ralloc.h,
+       * src/pic16/ralloc.cc: IS_CONFIG_ADDRESS is made public and added
+       prototype in header, commented out some debug messages
+
 2004-05-26 Vangelis Rokas <vrokas AT otenet.gr>
 
        * src/pic16/glue.c,
index 294fc187bc79789be7b9d059677512d0d00ee113..97017bfe85ded6b79ebca0de0fc0548d4e0e3b44 100644 (file)
@@ -763,7 +763,7 @@ void pic16_assignConfigWordValue(int address, int value)
     break;
   }
 
-       fprintf(stderr,"setting config word to 0x%x\n",value);
+//     fprintf(stderr,"setting config word to 0x%x\n",value);
 
 }
 /*-----------------------------------------------------------------*
index afb296d0c8e88d153c6162cda4912bc9b6fff334..c797808f52da55639055d24b2ded92f07914b5ff 100644 (file)
@@ -614,23 +614,29 @@ pic16emitStaticSeg (memmap * map)
 #if 0
        fprintf(stderr, "\t%s: sym: %s\tused: %d\n", map->sname, sym->name, sym->used);
        printTypeChain( sym->type, stderr );
-       printf("\n");
+       fprintf(stderr, "\n");
 #endif
 
 
-      /* if it is "extern" then do nothing */
-      if (IS_EXTERN (sym->etype)) {
-       checkAddSym(&externs, sym);
-//     addSetHead(&externs, sym);
-       continue;
-      }
+       /* if it is "extern" then do nothing */
+       if (IS_EXTERN (sym->etype)) {
 
-      /* if it is not static add it to the public
-         table */
-      if (!IS_STATIC (sym->etype)) {
-        checkAddSym(&publics, sym);
-//     addSetHead (&publics, sym);
-      }
+               /* do not emit if it is a config word declaration */
+               if(!SPEC_ABSA(sym->etype)
+                       || (SPEC_ABSA(sym->etype) && !IS_CONFIG_ADDRESS(SPEC_ADDR(sym->etype))))
+                       checkAddSym(&externs, sym);
+         continue;
+       }
+
+       /* if it is not static add it to the public
+          table */
+       if (!IS_STATIC (sym->etype)) {
+
+               /* do not emit if it is a config word declaration */
+               if(!SPEC_ABSA(sym->etype)
+                       || (SPEC_ABSA(sym->etype) && !IS_CONFIG_ADDRESS(SPEC_ADDR(sym->etype))))
+                               checkAddSym(&publics, sym);
+       }
 
 #if 0
       /* print extra debug info if required */
@@ -660,6 +666,9 @@ pic16emitStaticSeg (memmap * map)
       /* if it has an absolute address */
       if (SPEC_ABSA (sym->etype))
        {
+               fprintf(stderr, "%s:%d spec_absa is true for symbol: %s\n",
+                       __FILE__, __LINE__, sym->name);
+                       
          if (options.debug || sym->level == 0)
            fprintf (code->oFile, " == 0x%04x\n", SPEC_ADDR (sym->etype));
 
@@ -669,6 +678,9 @@ pic16emitStaticSeg (memmap * map)
        }
       else
        {
+               fprintf(stderr, "%s:%d spec_absa is false for symbol: %s\n",
+                       __FILE__, __LINE__, sym->name);
+
          if (options.debug || sym->level == 0)
            fprintf (code->oFile, " == .\n");
 
index 655a3d5821fcf08f448bf91c1764b0c19c60efe1..dca8addf6d799e9c9ab1011687845e6a42f16884 100644 (file)
@@ -557,7 +557,7 @@ pic16_dirregWithName (char *name)
   return NULL; // name wasn't found in the hash table
 }
 
-static int IS_CONFIG_ADDRESS(int address)
+int IS_CONFIG_ADDRESS(int address)
 {
 
   return address >= 0x300000 && address <= 0x300000d;
@@ -589,7 +589,7 @@ pic16_allocDirReg (operand *op )
                return NULL;                                                                                    //
        }                                                                                                       // patch 13
 
-       debugLog ("%s symbol name %s\n", __FUNCTION__,name);
+       debugLog ("%s:%d symbol name %s\n", __FUNCTION__, __LINE__, name);
 //     fprintf(stderr, "%s symbol name %s\n", __FUNCTION__,name);
 
        {
@@ -654,8 +654,8 @@ pic16_allocDirReg (operand *op )
                 * dynDirectRegNames set */
                if(IN_CODESPACE( SPEC_OCLS( OP_SYM_ETYPE(op)))) {
                        if(pic16_debug_verbose)
-//                             fprintf(stderr, "%s:%d symbol %s in codespace\n", __FILE__, __LINE__,
-//                                     OP_SYMBOL(op)->name);
+                               fprintf(stderr, "%s:%d symbol %s in codespace\n", __FILE__, __LINE__,
+                                       OP_SYMBOL(op)->name);
                        debugLog("%s:%d sym: %s in codespace\n", __FUNCTION__, __LINE__, OP_SYMBOL(op)->name);
                  return NULL;
                }
@@ -711,7 +711,7 @@ pic16_allocDirReg (operand *op )
        
                } else {
                        debugLog ("  -- %s is declared at address 0x30000x\n",name);
-                       fprintf(stderr, "  -- %s is declared at address 0x30000x\n",name);
+//                     fprintf(stderr, "  -- %s is declared at address 0x30000x\n",name);
        
                  return NULL;
                }
@@ -2784,6 +2784,8 @@ packRegsForAssign (iCode * ic, eBBlock * ebp)
   debugAopGet ("  left:", IC_LEFT (ic));
   debugAopGet ("  right:", IC_RIGHT (ic));
 
+//     fprintf(stderr, "%s:%d symbol = %s\n", __FILE__, __LINE__, OP_SYMBOL( IC_RESULT(ic))->name);
+
   /* if this is at an absolute address, then get the address. */
   if (SPEC_ABSA ( OP_SYM_ETYPE(IC_RESULT(ic))) ) {
     if(IS_CONFIG_ADDRESS( SPEC_ADDR ( OP_SYM_ETYPE(IC_RESULT(ic))))) {
@@ -2791,8 +2793,8 @@ packRegsForAssign (iCode * ic, eBBlock * ebp)
       if(IS_VALOP(IC_RIGHT(ic))) {
        debugLog ("  setting config word to %x\n", 
                  (int) floatFromVal (IC_RIGHT(ic)->operand.valOperand));
-       fprintf(stderr, "  setting config word to %x\n", 
-                 (int) floatFromVal (IC_RIGHT(ic)->operand.valOperand));
+//     fprintf(stderr, "  setting config word to %x\n", 
+//               (int) floatFromVal (IC_RIGHT(ic)->operand.valOperand));
        pic16_assignConfigWordValue(  SPEC_ADDR ( OP_SYM_ETYPE(IC_RESULT(ic))),
                                (int) floatFromVal (IC_RIGHT(ic)->operand.valOperand));
       }
index 3d7bc269ab8cd329496e3777f9fb750e8012af61..989347bd5c265c7c0ce6fd7df5b069d2d9afea3c 100644 (file)
@@ -121,6 +121,8 @@ regs *pic16_allocRegByName (char *name, int size );
 
 regs* newReg(short type, short pc_type, int rIdx, char *name, int size, int alias, operand *refop);
 
+int IS_CONFIG_ADDRESS(int address);
+
 /* Define register address that are constant across PIC16 family */
 #define IDX_TMR0    0xfd6
 #define IDX_PCL     0xff9