Files
2026-04-27 12:48:24 +03:00

32 lines
932 B
C++

#pragma once
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include "mlir/IR/PatternMatch.h"
namespace clift {
//===------------------ Future PatternRewriter functions ------------------===//
void inlineBlockBefore(mlir::PatternRewriter &Rewriter,
mlir::Block *Src,
mlir::Block *Dst,
mlir::Block::iterator Pos);
//===------------------------------- Helpers ------------------------------===//
inline void inlineRegionAtEnd(mlir::PatternRewriter &Rewriter,
mlir::Region &Source,
mlir::Region &Destination) {
Rewriter.inlineRegionBefore(Source, Destination, Destination.end());
}
inline void clearRegion(mlir::PatternRewriter &Rewriter, mlir::Region &Region) {
while (not Region.empty())
Rewriter.eraseBlock(&Region.front());
}
} // namespace clift