Changed codegen for postfix inc/dec operations by deferring them till sequence points.
This usually allows faster & smaller code. Note that deferred operations must still be called at sequence points even if the whole expressions containing them had constant values.
This commit is contained in:
@@ -320,6 +320,9 @@ static void Parse (void)
|
||||
} else {
|
||||
/* Parse the function body */
|
||||
NewFunc (Entry, FuncDef);
|
||||
|
||||
/* Make sure we aren't omitting any work */
|
||||
CheckDeferredOpAllDone ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,6 +398,8 @@ void Compile (const char* FileName)
|
||||
/* DefineNumericMacro ("__STDC__", 1); <- not now */
|
||||
DefineNumericMacro ("__STDC_HOSTED__", 1);
|
||||
|
||||
InitDeferredOps ();
|
||||
|
||||
/* Create the base lexical level */
|
||||
EnterGlobalLevel ();
|
||||
|
||||
@@ -486,6 +491,8 @@ void Compile (const char* FileName)
|
||||
}
|
||||
}
|
||||
|
||||
DoneDeferredOps ();
|
||||
|
||||
if (Debug) {
|
||||
PrintMacroStats (stdout);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user