Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Move AsmParser::parseTypeList() out-of-line (NFC)
Browse files Browse the repository at this point in the history
There is an ABI incompatibility between clang and gcc that is unfortunate and
has bitten users multiple times already.

Fixes #62918
  • Loading branch information
joker-eph committed Sep 27, 2023
1 parent 435da4e commit 76ce473
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 1 addition & 4 deletions mlir/include/mlir/IR/OpImplementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1242,10 +1242,7 @@ class AsmParser {
}

/// Parse a type list.
ParseResult parseTypeList(SmallVectorImpl<Type> &result) {
return parseCommaSeparatedList(
[&]() { return parseType(result.emplace_back()); });
}
ParseResult parseTypeList(SmallVectorImpl<Type> &result);

/// Parse an arrow followed by a type list.
virtual ParseResult parseArrowTypeList(SmallVectorImpl<Type> &result) = 0;
Expand Down
9 changes: 9 additions & 0 deletions mlir/lib/IR/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Type> &result) {
return parseCommaSeparatedList(
[&]() { return parseType(result.emplace_back()); });
}



//===----------------------------------------------------------------------===//
// DialectAsmPrinter
//===----------------------------------------------------------------------===//
Expand Down

0 comments on commit 76ce473

Please sign in to comment.