diff --git a/mlir/include/mlir/IR/OpImplementation.h b/mlir/include/mlir/IR/OpImplementation.h index 8864ef02cd3c..f1fabf95a68b 100644 --- a/mlir/include/mlir/IR/OpImplementation.h +++ b/mlir/include/mlir/IR/OpImplementation.h @@ -1242,10 +1242,7 @@ class AsmParser { } /// Parse a type list. - ParseResult parseTypeList(SmallVectorImpl &result) { - return parseCommaSeparatedList( - [&]() { return parseType(result.emplace_back()); }); - } + ParseResult parseTypeList(SmallVectorImpl &result); /// Parse an arrow followed by a type list. virtual ParseResult parseArrowTypeList(SmallVectorImpl &result) = 0; diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp index 7b0da30541b1..d8f2854f4efe 100644 --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -67,6 +67,15 @@ OpAsmParser::~OpAsmParser() = default; MLIRContext *AsmParser::getContext() const { return getBuilder().getContext(); } +/// Parse a type list. +/// This is out-of-line to work-around https://github.com/llvm/llvm-project/issues/62918 +ParseResult AsmParser::parseTypeList(SmallVectorImpl &result) { + return parseCommaSeparatedList( + [&]() { return parseType(result.emplace_back()); }); + } + + + //===----------------------------------------------------------------------===// // DialectAsmPrinter //===----------------------------------------------------------------------===//