mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
c835baf65a
Contains APIs from upstream LLVM that are not yet present in the current version, as well as helpers not present in upstream. See upstream commit 42c31d8302ff8f716601df9c276a5cd9ace6b158.
32 lines
944 B
C++
32 lines
944 B
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "mlir/IR/PatternMatch.h"
|
|
|
|
namespace mlir::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 mlir::clift
|