Add fast path for char postinc
This commit is contained in:
@@ -1534,6 +1534,14 @@ static void PostInc (ExprDesc* Expr)
|
||||
/* Get the data type */
|
||||
Flags = TypeOf (Expr->Type);
|
||||
|
||||
/* Fast path: char */
|
||||
if ((Flags & CF_CHAR) == CF_CHAR && ED_GetLoc(Expr) & (E_LOC_GLOBAL | E_LOC_STATIC)) {
|
||||
|
||||
LoadExpr (CF_NONE, Expr);
|
||||
AddCodeLine ("inc %s", ED_GetLabelName(Expr, 0));
|
||||
|
||||
} else {
|
||||
|
||||
/* Push the address if needed */
|
||||
PushAddr (Expr);
|
||||
|
||||
@@ -1553,6 +1561,7 @@ static void PostInc (ExprDesc* Expr)
|
||||
|
||||
/* Restore the original value in the primary register */
|
||||
g_restore (Flags | CF_FORCECHAR);
|
||||
}
|
||||
|
||||
/* The result is always an expression, no reference */
|
||||
ED_MakeRValExpr (Expr);
|
||||
|
||||
Reference in New Issue
Block a user