[flang-commits] [flang] [llvm] [flang][MIF] Adding lowering for EVENT POST/WAIT statements (PR #210283)
via flang-commits
flang-commits at lists.llvm.org
Wed Oct 21 19:02:17 PDT 2026
================
@@ -213,6 +260,69 @@ static mlir::Value getSizeInBytes(fir::FirOpBuilder &builder,
return sizeInBytes;
}
+/// Compute an offset in bytes from the beginning of the elements provided in
+/// "val". Basically, if it is not a memory access operation for an array such
+/// as fir::ArrayCoorOp or fir::CoordinateOp, then the element's offset is zero.
+static mlir::Value computeOffsetInBytes(fir::FirOpBuilder &builder,
+ mlir::Location loc, mlir::Value box) {
+ mlir::Operation *defOp = box.getDefiningOp();
+ if (mlir::isa<fir::ConvertOp, fir::EmboxOp>(defOp)) {
+ llvm::TypeSwitch<mlir::Operation *>(defOp)
----------------
MattPD wrote:
The Linux and Windows CI builds now fail on this line with `too few template arguments for class template 'TypeSwitch'`. Since https://github.com/llvm/llvm-project/pull/233108, `MLIR_ENABLE_PDL_IN_PATTERNMATCH` defaults to off when MLIR is configured only as a dependency. With that option off, `mlir/IR/PatternMatch.h` no longer brings in `llvm/ADT/TypeSwitch.h`, and this file does not include it directly.
With that option off in my local build, compiling this file fails with the same error. Once the file includes `llvm/ADT/TypeSwitch.h`, compiling it with `-fsyntax-only` succeeds. Could this file include that header?
https://github.com/llvm/llvm-project/pull/210283
More information about the flang-commits
mailing list