Skip to content

Conversation

wecing
Copy link
Contributor

@wecing wecing commented Aug 15, 2025

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.

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
@llvmbot
Copy link
Member

llvmbot commented Aug 15, 2025

@llvm/pr-subscribers-mlir-spirv

Author: Chenguang Wang (wecing)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/153727.diff

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.h (+2)
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_

@llvmbot
Copy link
Member

llvmbot commented Aug 15, 2025

@llvm/pr-subscribers-mlir

Author: Chenguang Wang (wecing)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/153727.diff

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/SPIRV/Interfaces/SPIRVImageInterfaces.h (+2)
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_

@wecing wecing merged commit 3f797a8 into llvm:main Aug 15, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants