+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,
break;
}
- fprintf(stderr,"setting config word to 0x%x\n",value);
+// fprintf(stderr,"setting config word to 0x%x\n",value);
}
/*-----------------------------------------------------------------*
#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 */
/* 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));
}
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");
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;
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);
{
* 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;
}
} 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;
}
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))))) {
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));
}
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