if (ASSIGN_ITEMP_TO_ITEMP(ic) &&
!SPIL_LOC(IC_RIGHT(ic)) &&
+ bitVectnBitsOn(OP_USES(IC_RIGHT(ic))) == 0 &&
OP_SYMBOL(IC_RESULT(ic))->isreqv) {
setype = getSpec(operandType(IC_RESULT(ic)));
*oud = bitVectUnion(*oud,adefs);
}
+/*-----------------------------------------------------------------*/
+/* unsetDefsAndUses - clear this operation for the operands */
+/*-----------------------------------------------------------------*/
+void unsetDefsAndUses ( iCode *ic )
+{
+ if ( ic->op == JUMPTABLE)
+ return ;
+
+ /* take away this definition from the def chain of the */
+ /* result & take away from use set of the operands */
+ if (ic->op != IFX) {
+ /* turn off def set */
+ if (IS_SYMOP(IC_RESULT(ic))) {
+ if ( !POINTER_SET(ic))
+ bitVectUnSetBit(OP_DEFS(IC_RESULT(ic)),ic->key);
+ else
+ bitVectUnSetBit(OP_USES(IC_RESULT(ic)),ic->key);
+ }
+ /* turn off the useSet for the operands */
+ if (IS_SYMOP(IC_LEFT(ic)))
+ bitVectUnSetBit (OP_USES(IC_LEFT(ic)),ic->key);
+
+ if (IS_SYMOP(IC_RIGHT(ic)))
+ bitVectUnSetBit (OP_USES(IC_RIGHT(ic)),ic->key);
+ }
+ else /* must be ifx turn off the use */
+ if (IS_SYMOP(IC_COND(ic)))
+ bitVectUnSetBit (OP_USES(IC_COND(ic)),ic->key);
+}
+
/*-----------------------------------------------------------------*/
/* ifxOptimize - changes ifx conditions if it can */
/*-----------------------------------------------------------------*/
return ;
}
-/*-----------------------------------------------------------------*/
-/* unsetDefsAndUses - clear this operation for the operands */
-/*-----------------------------------------------------------------*/
-void unsetDefsAndUses ( iCode *ic )
-{
- if ( ic->op == JUMPTABLE)
- return ;
-
- /* take away this definition from the def chain of the */
- /* result & take away from use set of the operands */
- if (ic->op != IFX) {
- /* turn off def set */
- if (IS_SYMOP(IC_RESULT(ic))) {
- if ( !POINTER_SET(ic))
- bitVectUnSetBit(OP_DEFS(IC_RESULT(ic)),ic->key);
- else
- bitVectUnSetBit(OP_USES(IC_RESULT(ic)),ic->key);
- }
- /* turn off the useSet for the operands */
- if (IS_SYMOP(IC_LEFT(ic)))
- bitVectUnSetBit (OP_USES(IC_LEFT(ic)),ic->key);
-
- if (IS_SYMOP(IC_RIGHT(ic)))
- bitVectUnSetBit (OP_USES(IC_RIGHT(ic)),ic->key);
- }
- else /* must be ifx turn off the use */
- if (IS_SYMOP(IC_COND(ic)))
- bitVectUnSetBit (OP_USES(IC_COND(ic)),ic->key);
-}
-
/*-----------------------------------------------------------------*/
/* diCodeForSym - finds the definiting instruction for a symbol */
/*-----------------------------------------------------------------*/
memmap *sfrbit= NULL; /* sfr bit space */
memmap *generic=NULL; /* is a generic pointer */
memmap *overlay=NULL; /* overlay segment */
+memmap *eeprom =NULL; /* eeprom location */
/* this is a set of sets each set containing
symbols in a single overlay */
char codemap, /* this is code space */
unsigned sloc, /* starting location */
const char *name, /* 2 character name */
- char dbName
+ char dbName , /* debug name */
+ int ptrType /* pointer type for this space */
)
{
memmap *map ;
map->sloc = sloc ;
map->sname = name ;
map->dbName = dbName ;
+ map->ptrType= ptrType;
if (!(map->oFile = tmpfile())) {
werror(E_TMPFILE_FAILED);
exit (1);
PAGED - YES
DIRECT-ACCESS - NO
BIT-ACCESS - NO
- CODE-ACESS - NO */
- xstack = allocMap (0, 1, 1, 0, 0, 0, options.xstack_loc, XSTACK_NAME,'A');
+ CODE-ACESS - NO
+ DEBUG-NAME - 'A'
+ POINTER-TYPE - FPOINTER
+ */
+ xstack = allocMap (0, 1, 1, 0, 0, 0, options.xstack_loc, XSTACK_NAME,'A',FPOINTER);
/* internal stack segment ;
SFRSPACE - NO
PAGED - NO
DIRECT-ACCESS - NO
BIT-ACCESS - NO
- CODE-ACESS - NO */
- istack = allocMap (0, 0, 0, 0, 0, 0,options.stack_loc, ISTACK_NAME,'B');
+ CODE-ACESS - NO
+ DEBUG-NAME - 'B'
+ POINTER-TYPE - POINTER
+ */
+ istack = allocMap (0, 0, 0, 0, 0, 0,options.stack_loc, ISTACK_NAME,'B',POINTER);
/* code segment ;
SFRSPACE - NO
PAGED - NO
DIRECT-ACCESS - NO
BIT-ACCESS - NO
- CODE-ACESS - YES */
- code = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, CODE_NAME,'C');
+ CODE-ACESS - YES
+ DEBUG-NAME - 'C'
+ POINTER-TYPE - CPOINTER
+ */
+ code = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, CODE_NAME,'C',CPOINTER);
/* Static segment (code for variables );
SFRSPACE - NO
PAGED - NO
DIRECT-ACCESS - NO
BIT-ACCESS - NO
- CODE-ACESS - YES */
- statsg = allocMap (0, 1, 0, 0, 0, 1,0, STATIC_NAME,'D');
+ CODE-ACESS - YES
+ DEBUG-NAME - 'D'
+ POINTER-TYPE - CPOINTER
+ */
+ statsg = allocMap (0, 1, 0, 0, 0, 1,0, STATIC_NAME,'D',CPOINTER);
/* Data segment - internal storage segment ;
SFRSPACE - NO
PAGED - NO
DIRECT-ACCESS - YES
BIT-ACCESS - NO
- CODE-ACESS - NO */
- data = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME,'E');
+ CODE-ACESS - NO
+ DEBUG-NAME - 'E'
+ POINTER-TYPE - POINTER
+ */
+ data = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME,'E',POINTER);
/* overlay segment - same as internal storage segment ;
SFRSPACE - NO
PAGED - NO
DIRECT-ACCESS - YES
BIT-ACCESS - NO
- CODE-ACESS - NO */
- overlay = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME,'E');
+ CODE-ACESS - NO
+ DEBUG-NAME - 'E'
+ POINTER-TYPE - POINTER
+ */
+ overlay = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME,'E',POINTER);
/* Xternal Data segment -
SFRSPACE - NO
PAGED - NO
DIRECT-ACCESS - NO
BIT-ACCESS - NO
- CODE-ACESS - NO */
- xdata = allocMap (0, 1, 0, 0, 0, 0, options.xdata_loc, XDATA_NAME,'F' );
+ CODE-ACESS - NO
+ DEBUG-NAME - 'F'
+ POINTER-TYPE - FPOINTER
+ */
+ xdata = allocMap (0, 1, 0, 0, 0, 0, options.xdata_loc, XDATA_NAME,'F',FPOINTER);
/* Inderectly addressed internal data segment
SFRSPACE - NO
PAGED - NO
DIRECT-ACCESS - NO
BIT-ACCESS - NO
- CODE-ACESS - NO */
- idata = allocMap (0, 0, 0, 0, 0, 0, options.idata_loc,IDATA_NAME,'G' );
+ CODE-ACESS - NO
+ DEBUG-NAME - 'G'
+ POINTER-TYPE - IPOINTER
+ */
+ idata = allocMap (0, 0, 0, 0, 0, 0, options.idata_loc,IDATA_NAME,'G',IPOINTER);
/* Static segment (code for variables );
SFRSPACE - NO
PAGED - NO
DIRECT-ACCESS - YES
BIT-ACCESS - YES
- CODE-ACESS - NO */
- bit = allocMap (0, 0, 0, 1, 1, 0,0, BIT_NAME,'H');
+ CODE-ACESS - NO
+ DEBUG-NAME - 'H'
+ POINTER-TYPE - _NONE_
+ */
+ bit = allocMap (0, 0, 0, 1, 1, 0,0, BIT_NAME,'H',0);
/* Special function register space :-
SFRSPACE - YES
PAGED - NO
DIRECT-ACCESS - YES
BIT-ACCESS - NO
- CODE-ACESS - NO */
- sfr = allocMap (1,0, 0, 1, 0, 0,0, REG_NAME,'I');
+ CODE-ACESS - NO
+ DEBUG-NAME - 'I'
+ POINTER-TYPE - _NONE_
+ */
+ sfr = allocMap (1,0, 0, 1, 0, 0,0, REG_NAME,'I',0);
/* Register space ;
SFRSPACE - YES
PAGED - NO
DIRECT-ACCESS - NO
BIT-ACCESS - NO
- CODE-ACESS - NO */
- reg = allocMap (1,0, 0, 0, 0, 0, 0,REG_NAME,' ');
+ CODE-ACESS - NO
+ DEBUG-NAME - ' '
+ POINTER-TYPE - _NONE_
+ */
+ reg = allocMap (1,0, 0, 0, 0, 0, 0,REG_NAME,' ',0);
/* SFR bit space
SFRSPACE - YES
PAGED - NO
DIRECT-ACCESS - YES
BIT-ACCESS - YES
- CODE-ACESS - NO */
- sfrbit = allocMap (1,0, 0, 1, 1, 0,0, REG_NAME,'J' );
+ CODE-ACESS - NO
+ DEBUG-NAME - 'J'
+ POINTER-TYPE - _NONE_
+ */
+ sfrbit = allocMap (1,0, 0, 1, 1, 0,0, REG_NAME,'J',0);
/* the unknown map */
- generic = allocMap (1,0, 0, 1, 1, 0,0, REG_NAME,' ' );
-
+ generic = allocMap (1,0, 0, 1, 1, 0,0, REG_NAME,' ',GPOINTER);
+
}
/*-----------------------------------------------------------------*/
struct set ;
struct value ;
typedef struct memmap{
- unsigned char pageno;/* page no for this variable */
+ unsigned char pageno; /* page no for this variable */
const char *sname; /* character prefix for map */
- char dbName ; /* debugger address space name */
- int slbl ; /* label counter for space */
- unsigned sloc ; /* starting location */
- unsigned fmap : 1; /* 1 = 16bit addressing reqd */
- unsigned paged : 1; /* this is a paged mem space */
- unsigned direct: 1; /* 1= indirect access only */
- unsigned bitsp: 1; /* 1 = bit addressable space */
- unsigned codesp:1; /* 1 = code space */
- unsigned regsp: 1; /* 1= sfr space */
- FILE *oFile ; /* object file associated */
- struct set *syms; /* symbols defined in this segment */
+ char dbName ; /* debugger address space name */
+ int ptrType; /* pointer Type for this space */
+ int slbl ; /* label counter for space */
+ unsigned sloc ; /* starting location */
+ unsigned fmap : 1; /* 1 = 16bit addressing reqd */
+ unsigned paged : 1; /* this is a paged mem space */
+ unsigned direct: 1; /* 1= indirect access only */
+ unsigned bitsp: 1; /* 1 = bit addressable space */
+ unsigned codesp:1; /* 1 = code space */
+ unsigned regsp: 1; /* 1= sfr space */
+ FILE *oFile ; /* object file associated */
+ struct set *syms; /* symbols defined in this segment */
} memmap ;
extern FILE *junkFile ;
extern memmap *_const; /* constant segment */
extern memmap *generic; /* unknown */
extern memmap *overlay; /* the overlay segment */
+extern memmap *eeprom; /* eepromp space */
extern struct set *ovrSetSets;
#define IN_CODESPACE(map) (map && map->codesp)
/* forward decls for functions */
-memmap *allocMap (char,char,char,char,char,char,unsigned, const char *,char );
+memmap *allocMap (char,char,char,char,char,char,unsigned, const char *,char,int );
void initMem ( );
void allocGlobal (struct symbol * );
void allocLocal (struct symbol * );