break;
case E_LOC_STATIC:
- /* Static variable */
+ case E_LOC_LITERAL:
+ /* Static variable or literal in the literal pool */
g_defdata (CF_STATIC, Expr->Name, Expr->Val);
break;
g_defdata (CF_REGVAR, Expr->Name, Expr->Val);
break;
- case E_LOC_LITERAL:
- /* Literal in the literal pool */
- g_defdata (CF_STATIC, LiteralPoolLabel, Expr->Val);
- break;
-
default:
Internal ("Unknown constant type: 0x%04X", ED_GetLoc (Expr));
}
break;
case E_LOC_STATIC:
- /* Static symbol, load address */
+ case E_LOC_LITERAL:
+ /* Static symbol or literal, load address */
g_getimmed ((Flags | CF_STATIC) & ~CF_CONST, Expr->Name, Expr->Val);
break;
g_leasp (Expr->Val);
break;
- case E_LOC_LITERAL:
- /* Literal string */
- g_getimmed (CF_STATIC, LiteralPoolLabel, Expr->Val);
- break;
-
default:
Internal ("Unknown constant type: %04X", Expr->Flags);
}
break;
case E_LOC_STATIC:
- /* Static variable */
+ case E_LOC_LITERAL:
+ /* Static variable or literal in the literal pool */
g_getstatic (Flags | CF_STATIC, Expr->Name, Expr->Val);
break;
g_getind (Flags, Expr->Val);
break;
- case E_LOC_LITERAL:
- /* Literal in the literal pool */
- g_getstatic (Flags | CF_STATIC, LiteralPoolLabel, Expr->Val);
- break;
-
default:
Internal ("Invalid location in ExprLoad: 0x%04X", ED_GetLoc (Expr));
}
case TOK_SCONST:
/* String literal */
- E->Flags = E_LOC_LITERAL | E_RTYPE_RVAL;
- E->Val = CurTok.IVal;
E->Type = GetCharArrayType (GetLiteralPoolOffs () - CurTok.IVal);
+ E->Flags = E_LOC_LITERAL | E_RTYPE_RVAL;
+ E->Val = CurTok.IVal;
+ E->Name = LiteralPoolLabel;
NextToken ();
break;
break;
case E_LOC_STATIC:
- /* Static variable */
+ case E_LOC_LITERAL:
+ /* Static variable or literal in the literal pool */
g_putstatic (Flags | CF_STATIC, Expr->Name, Expr->Val);
break;
g_putind (Flags, Expr->Val);
break;
- case E_LOC_LITERAL:
- /* Literal in the literal pool */
- g_putstatic (Flags | CF_STATIC, LiteralPoolLabel, Expr->Val);
- break;
-
default:
Internal ("Invalid location in Store(): 0x%04X", ED_GetLoc (Expr));
}
break;
case E_LOC_STATIC:
- /* Static variable */
+ case E_LOC_LITERAL:
+ /* Static variable or literal in the literal pool */
g_addeqstatic (Flags | CF_STATIC, Expr->Name, Expr->Val, Val);
break;
g_addeqind (Flags, Expr->Val, Val);
break;
- case E_LOC_LITERAL:
- /* Literal in the literal pool */
- g_addeqstatic (Flags | CF_STATIC, LiteralPoolLabel, Expr->Val, Val);
- break;
-
default:
Internal ("Invalid location in PreInc(): 0x%04X", ED_GetLoc (Expr));
}
break;
case E_LOC_STATIC:
- /* Static variable */
+ case E_LOC_LITERAL:
+ /* Static variable or literal in the literal pool */
g_subeqstatic (Flags | CF_STATIC, Expr->Name, Expr->Val, Val);
break;
g_subeqind (Flags, Expr->Val, Val);
break;
- case E_LOC_LITERAL:
- /* Literal in the literal pool */
- g_subeqstatic (Flags | CF_STATIC, LiteralPoolLabel, Expr->Val, Val);
- break;
-
default:
Internal ("Invalid location in PreDec(): 0x%04X", ED_GetLoc (Expr));
}
break;
case E_LOC_STATIC:
- /* Static variable */
+ case E_LOC_LITERAL:
+ /* Static variable or literal in the literal pool */
lflags |= CF_STATIC;
if (Gen->Tok == TOK_PLUS_ASSIGN) {
g_addeqstatic (lflags, Expr->Name, Expr->Val, Expr2.Val);
}
break;
- case E_LOC_LITERAL:
- /* Literal in the literal pool */
- lflags |= CF_STATIC;
- if (Gen->Tok == TOK_PLUS_ASSIGN) {
- g_addeqstatic (lflags, LiteralPoolLabel, Expr->Val, Expr2.Val);
- } else {
- g_subeqstatic (lflags, LiteralPoolLabel, Expr->Val, Expr2.Val);
- }
- break;
-
default:
Internal ("Invalid location in Store(): 0x%04X", ED_GetLoc (Expr));
}