diff --git a/flang/include/flang/Optimizer/Dialect/FIRType.h b/flang/include/flang/Optimizer/Dialect/FIRType.h --- a/flang/include/flang/Optimizer/Dialect/FIRType.h +++ b/flang/include/flang/Optimizer/Dialect/FIRType.h @@ -22,6 +22,11 @@ class FIROpsDialect; class KindMapping; using KindTy = unsigned; + +namespace detail { +struct RecordTypeStorage; +} // namespace detail + } // namespace fir //===----------------------------------------------------------------------===// diff --git a/mlir/include/mlir/IR/BuiltinAttributes.h b/mlir/include/mlir/IR/BuiltinAttributes.h --- a/mlir/include/mlir/IR/BuiltinAttributes.h +++ b/mlir/include/mlir/IR/BuiltinAttributes.h @@ -31,6 +31,12 @@ class Operation; class RankedTensorType; +namespace detail { +struct DenseIntOrFPElementsAttrStorage; +struct DenseStringElementsAttrStorage; +struct StringAttrStorage; +} // namespace detail + //===----------------------------------------------------------------------===// // Elements Attributes //===----------------------------------------------------------------------===// diff --git a/mlir/include/mlir/IR/BuiltinTypes.h b/mlir/include/mlir/IR/BuiltinTypes.h --- a/mlir/include/mlir/IR/BuiltinTypes.h +++ b/mlir/include/mlir/IR/BuiltinTypes.h @@ -32,6 +32,12 @@ class StringAttr; class TypeRange; +namespace detail { +struct FunctionTypeStorage; +struct IntegerTypeStorage; +struct TupleTypeStorage; +} // namespace detail + //===----------------------------------------------------------------------===// // FloatType //===----------------------------------------------------------------------===// diff --git a/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp b/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp --- a/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp +++ b/mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp @@ -67,7 +67,7 @@ DefGen(const AttrOrTypeDef &def); void emitDecl(raw_ostream &os) const { - if (storageCls) { + if (storageCls && def.genStorageClass()) { NamespaceEmitter ns(os, def.getStorageNamespace()); os << "struct " << def.getStorageClassName() << ";\n"; }