ee8690563d
The bodies provided to COMPILER_PASS macro uses are put into a DoBody method of a generated class that has the following signature: virtual bool DoBody(CompilerPassState* state); CompilerState::Run uses this return value to decide whether to repeat a given pass. Previously, if no precompiler was provided in the compiler state, the SerializeGraph compiler pass returned the compiler state. Since the compiler state itself was not nullptr, it would implicitly convert to true, meaning that CompilerState::Run would always run SerializeGraph twice in this case. Since SerializeGraph was marked as an AOT pass, though, this case never happened as the precompiler is always provided for AOT passes. In the meantime, others have used it as a basis for new compiler passes with early returns that _could_ happen and then were confused by seeing the pass happen twice in those cases. Fix the return value so it avoids such confusion in the future. Change-Id: I3a91e84abe2fbcc8437c64ce1b5b91f3d4808c65 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161784 Reviewed-by: Daco Harkes <dacoharkes@google.com> Commit-Queue: Tess Strickland <sstrickl@google.com>