-typedef struct operand {
- OPTYPE type; /* type of operand */
- unsigned int isaddr : 1; /* is an address */
- unsigned int isvolatile: 1; /* is a volatile operand */
- unsigned int isGlobal :1 ; /* is a global operand */
- unsigned int isPtr :1 ; /* is assigned a pointer */
- unsigned int isGptr :1 ; /* is a generic pointer */
- unsigned int isParm :1 ; /* is a parameter */
- unsigned int isLiteral:1 ; /* operand is literal */
- unsigned int noSpilLoc:1 ; /* cannot be assigned a spil location */
-
- unsigned key ;
- int parmBytes;
- union {
- struct symbol *symOperand ; /* operand is of type symbol */
- struct value *valOperand ; /* operand is of type value */
- struct sym_link *typeOperand; /* operand is of type typechain */
- } operand ;
-
- bitVect *usesDefs; /* which definitions are used by this */
- struct asmop *aop ; /* asm op for this operand */
-} operand ;
-
-/* definition for intermediate code */
+typedef struct operand
+ {
+ OPTYPE type; /* type of operand */
+ unsigned int isaddr:1; /* is an address */
+ unsigned int aggr2ptr:2; /* 1: must change aggregate to pointer to aggregate */
+ /* 2: aggregate has been changed to pointer to aggregate */
+ unsigned int isvolatile:1; /* is a volatile operand */
+ unsigned int isGlobal:1; /* is a global operand */
+ unsigned int isPtr:1; /* is assigned a pointer */
+ unsigned int isGptr:1; /* is a generic pointer */
+ unsigned int isParm:1; /* is a parameter */
+ unsigned int isLiteral:1; /* operand is literal */
+
+ int key;
+ union
+ {
+ struct symbol *symOperand; /* operand is of type symbol */
+ struct value *valOperand; /* operand is of type value */
+ struct sym_link *typeOperand; /* operand is of type typechain */
+ }
+ operand;
+
+ bitVect *usesDefs; /* which definitions are used by this */
+ struct asmop *aop; /* asm op for this operand */
+ }
+operand;
+
+extern operand *validateOpType(operand *op,
+ const char *macro,
+ const char *args,
+ OPTYPE type,
+ const char *file,
+ unsigned line);
+
+#define OP_SYMBOL(op) validateOpType(op, "OP_SYMBOL", #op, SYMBOL, __FILE__, __LINE__)->operand.symOperand
+#define OP_VALUE(op) validateOpType(op, "OP_VALUE", #op, VALUE, __FILE__, __LINE__)->operand.valOperand
+#define OP_SYM_TYPE(op) validateOpType(op, "OP_SYM_TYPE", #op, SYMBOL, __FILE__, __LINE__)->operand.symOperand->type
+#define OP_SYM_ETYPE(op) validateOpType(op, "OP_SYM_ETYPE", #op, SYMBOL, __FILE__, __LINE__)->operand.symOperand->etype
+#define SPIL_LOC(op) validateOpType(op, "SPIL_LOC", #op, SYMBOL, __FILE__, __LINE__)->operand.symOperand->usl.spillLoc
+#define OP_LIVEFROM(op) validateOpType(op, "OP_LIVEFROM", #op, SYMBOL, __FILE__, __LINE__)->operand.symOperand->liveFrom
+#define OP_LIVETO(op) validateOpType(op, "OP_LIVETO", #op, SYMBOL, __FILE__, __LINE__)->operand.symOperand->liveTo
+#define OP_REQV(op) validateOpType(op, "OP_REQV", #op, SYMBOL, __FILE__, __LINE__)->operand.symOperand->reqv
+
+/* definition for intermediate code */