[Mlir-commits] [mlir] [mlir][spirv] Add missing #include in SPIRVImageInterfaces.h (PR #153727)

Chenguang Wang llvmlistbot at llvm.org
Thu Aug 14 18:52:57 PDT 2025


https://github.com/wecing created https://github.com/llvm/llvm-project/pull/153727

SPIRVImageInterfaces.h.inc uses some types, e.g. mlir::TypedValue, without #include the necessary headers. This is fine most of the time, but we did run into a weird case where bazel fails to compile //mlir:SPIRVImageInterfaces on clang19 for ChromiumOS when parse_headers (see [1]) is specified.

[1]: https://bazel.build/docs/bazel-and-cpp#toolchain-features

>From 6156488c35679790c9c1af6bb3d00dde5f2f702c Mon Sep 17 00:00:00 2001
From: Chenguang Wang <w3cing at gmail.com>
Date: Thu, 14 Aug 2025 18:50:07 -0700
Subject: [PATCH] [mlir][spirv] Add missing #include in SPIRVImageInterfaces.h

SPIRVImageInterfaces.h.inc uses some types, e.g. mlir::TypedValue,
without #include the necessary headers. This is fine most of the time,
but we did run into a weird case where bazel fails to compile
//mlir:SPIRVImageInterfaces on clang19 for ChromiumOS when parse_headers
(see [1]) is specified.

[1]: https://bazel.build/docs/bazel-and-cpp#toolchain-features
---
 .../mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.h        | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mlir/include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.h b/mlir/include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.h
index ca5a1dcd88171..0c70d4fafd246 100644
--- a/mlir/include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.h
+++ b/mlir/include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.h
@@ -9,6 +9,8 @@
 #ifndef MLIR_DIALECT_SPIRV_IMAGE_INTERFACES_H_
 #define MLIR_DIALECT_SPIRV_IMAGE_INTERFACES_H_
 
+#include "mlir/IR/OpDefinition.h"
+
 #include "mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.h.inc"
 
 #endif // MLIR_DIALECT_SPIRV_IMAGE_INTERFACES_H_



More information about the Mlir-commits mailing list