blob: 7f06207df7a0be5feb01cc9bca502d308b4aaa9e [file] [log] [blame]
// Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.ir.conversion;
import com.android.tools.r8.utils.collections.ProgramMethodSet;
import java.util.Collection;
/**
* An abstraction of optimizations that require post processing of methods.
*/
public interface PostOptimization {
/** @return a set of methods that need post processing. */
ProgramMethodSet methodsToRevisit();
// TODO(b/127694949): different CodeOptimization for primary processor v.s. post processor?
// In that way, instead of internal state changes, such as COLLECT v.s. APPLY or REVISIT,
// optimizers that need post processing can return what to do at each processor.
// Collection<CodeOptimization> codeOptimizationsForPrimaryProcessing();
/**
* @return specific collection of {@link CodeOptimization}s to conduct during post processing.
* Otherwise, i.e., if the default one---IRConverter's full processing---is okay,
* returns {@code null}.
*/
Collection<CodeOptimization> codeOptimizationsForPostProcessing();
}