1 //===- PassManager.cpp - Runs a pipeline of Sandbox IR passes -------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm/SandboxIR/PassManager.h"
11 namespace llvm::sandboxir
{
13 bool FunctionPassManager::runOnFunction(Function
&F
, const Analyses
&A
) {
15 for (auto &Pass
: Passes
) {
16 Change
|= Pass
->runOnFunction(F
, A
);
17 // TODO: run the verifier.
19 // TODO: Check ChangeAll against hashes before/after.
23 bool RegionPassManager::runOnRegion(Region
&R
, const Analyses
&A
) {
25 for (auto &Pass
: Passes
) {
26 Change
|= Pass
->runOnRegion(R
, A
);
27 // TODO: run the verifier.
29 // TODO: Check ChangeAll against hashes before/after.
33 } // namespace llvm::sandboxir