From f6e79724ef45ed7eef48ab15987e25452bc5fb49 Mon Sep 17 00:00:00 2001 From: Abhishek Bagusetty <59661409+abagusetty@users.noreply.github.com> Date: Mon, 22 Dec 2025 04:36:40 -0600 Subject: [PATCH] [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 --- mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp b/mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp index 48634a17ae32..c3b1de0dff18 100644 --- a/mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp +++ b/mlir/tools/tblgen-to-irdl/OpDefinitionsGen.cpp @@ -122,7 +122,7 @@ static std::optional recordToType(MLIRContext *ctx, } if (predRec.getName() == "NoneType") { - return NoneType::get(ctx); + return mlir::NoneType::get(ctx); } if (predRec.getName() == "BF16") {