Skip to content

Commit 76ce473

Browse files
committed
Move AsmParser::parseTypeList() out-of-line (NFC)
There is an ABI incompatibility between clang and gcc that is unfortunate and has bitten users multiple times already. Fixes #62918
1 parent 435da4e commit 76ce473

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

mlir/include/mlir/IR/OpImplementation.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,10 +1242,7 @@ class AsmParser {
12421242
}
12431243

12441244
/// Parse a type list.
1245-
ParseResult parseTypeList(SmallVectorImpl<Type> &result) {
1246-
return parseCommaSeparatedList(
1247-
[&]() { return parseType(result.emplace_back()); });
1248-
}
1245+
ParseResult parseTypeList(SmallVectorImpl<Type> &result);
12491246

12501247
/// Parse an arrow followed by a type list.
12511248
virtual ParseResult parseArrowTypeList(SmallVectorImpl<Type> &result) = 0;

mlir/lib/IR/AsmPrinter.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ OpAsmParser::~OpAsmParser() = default;
6767

6868
MLIRContext *AsmParser::getContext() const { return getBuilder().getContext(); }
6969

70+
/// Parse a type list.
71+
/// This is out-of-line to work-around https://github.com/llvm/llvm-project/issues/62918
72+
ParseResult AsmParser::parseTypeList(SmallVectorImpl<Type> &result) {
73+
return parseCommaSeparatedList(
74+
[&]() { return parseType(result.emplace_back()); });
75+
}
76+
77+
78+
7079
//===----------------------------------------------------------------------===//
7180
// DialectAsmPrinter
7281
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)