[Mlir-commits] [mlir] e45ef5e - [mlir][ods] (NFC) Remove warning in `AttrOrTypeDef`

Jeff Niu llvmlistbot at llvm.org
Tue Jul 19 09:17:28 PDT 2022


Author: Jeff Niu
Date: 2022-07-19T09:17:19-07:00
New Revision: e45ef5ebf4402e553c9a0b10e8765811cc33bbdd

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

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

This warning was added because using attribute or type assembly formats
with `skipDefaultBuilders` set could cause compilation errors, since the
required builder prototype may not necessarily be generated and would
need to be checked by hand. This patch removes the warning because a
warning that the generated C++ "might" not compile is not particularly
useful. Attempting to address the TODO (i.e. detect whether a builder of
the correct prototype is provided) would be fragile since it would not
be possible to account for implicit conversions, etc.

In general, ODS should not be emitting warnings in cases like these.

Added: 
    

Modified: 
    mlir/lib/TableGen/AttrOrTypeDef.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/TableGen/AttrOrTypeDef.cpp b/mlir/lib/TableGen/AttrOrTypeDef.cpp
index acd0e5529fdd..0271a001816d 100644
--- a/mlir/lib/TableGen/AttrOrTypeDef.cpp
+++ b/mlir/lib/TableGen/AttrOrTypeDef.cpp
@@ -85,14 +85,6 @@ 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