[Mlir-commits] [mlir] f6e7972 - [mlir] fix the Disambiguate NoneType in OpDefinitionsGen (#172923)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Dec 22 02:36:44 PST 2025
Author: Abhishek Bagusetty
Date: 2025-12-22T11:36:40+01:00
New Revision: f6e79724ef45ed7eef48ab15987e25452bc5fb49
URL: https://github.com/llvm/llvm-project/commit/f6e79724ef45ed7eef48ab15987e25452bc5fb49
DIFF: https://github.com/llvm/llvm-project/commit/f6e79724ef45ed7eef48ab15987e25452bc5fb49.diff
LOG: [mlir] fix the Disambiguate NoneType in OpDefinitionsGen (#172923)
Qualify NoneType as mlir::NoneType in recordToType to avoid ambiguity
when other headers introduce a different NoneType symbol. This fixes
build failures seen when enabling tblgen-to-irdl in certain downstream
configurations
The ambiguity is between:
[llvm::Nonetype](https://github.com/intel/llvm/blob/sycl/llvm/include/llvm/ADT/None.h#L26)
and
[mlir::Nonetype](https://github.com/llvm/llvm-project/blob/main/mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp#L125)
Both are visible due to `using namespace mlir` and `using namespace
llvm` in the file.
Fixes: https://github.com/llvm/llvm-project/issues/160537
Added:
Modified:
mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp
Removed:
################################################################################
diff --git a/mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp b/mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp
index 48634a17ae32a..c3b1de0dff18d 100644
--- a/mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp
+++ b/mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp
@@ -122,7 +122,7 @@ static std::optional<Type> recordToType(MLIRContext *ctx,
}
if (predRec.getName() == "NoneType") {
- return NoneType::get(ctx);
+ return mlir::NoneType::get(ctx);
}
if (predRec.getName() == "BF16") {
More information about the Mlir-commits
mailing list