[Mlir-commits] [mlir] 2d05418 - Revert "[mlir][ods] (NFC) Remove warning in `AttrOrTypeDef`"

Jeff Niu llvmlistbot at llvm.org
Tue Jul 19 10:25:37 PDT 2022


Author: Jeff Niu
Date: 2022-07-19T10:25:24-07:00
New Revision: 2d05418b17c73595b44f968f0cc5148550ad785e

URL: https://github.com/llvm/llvm-project/commit/2d05418b17c73595b44f968f0cc5148550ad785e
DIFF: https://github.com/llvm/llvm-project/commit/2d05418b17c73595b44f968f0cc5148550ad785e.diff

LOG: Revert "[mlir][ods] (NFC) Remove warning in `AttrOrTypeDef`"

This reverts commit e45ef5ebf4402e553c9a0b10e8765811cc33bbdd.

Added: 
    

Modified: 
    mlir/lib/TableGen/AttrOrTypeDef.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/TableGen/AttrOrTypeDef.cpp b/mlir/lib/TableGen/AttrOrTypeDef.cpp
index 0271a001816d4..acd0e5529fdd7 100644
--- a/mlir/lib/TableGen/AttrOrTypeDef.cpp
+++ b/mlir/lib/TableGen/AttrOrTypeDef.cpp
@@ -85,6 +85,14 @@ AttrOrTypeDef::AttrOrTypeDef(const llvm::Record *def) : def(def) {
                     "'assemblyFormat' or 'hasCustomAssemblyFormat' can only be "
                     "used when 'mnemonic' is set");
   }
+  // Assembly format parser requires builders with the same prototype
+  // as the default-builders.
+  // TODO: attempt to detect when a custom builder matches the prototype.
+  if (hasDeclarativeFormat && skipDefaultBuilders()) {
+    PrintWarning(getLoc(),
+                 "using 'assemblyFormat' with 'skipDefaultBuilders=1' may "
+                 "result in C++ compilation errors");
+  }
   // Assembly format printer requires accessors to be generated.
   if (hasDeclarativeFormat && !genAccessors()) {
     PrintFatalError(getLoc(),


        


More information about the Mlir-commits mailing list