[Mlir-commits] [mlir] 76ce473 - Move AsmParser::parseTypeList() out-of-line (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Tue Sep 26 20:08:35 PDT 2023
Author: Mehdi Amini
Date: 2023-09-26T20:08:27-07:00
New Revision: 76ce4736721a6e9030210bda6df0ad8a8f478a19
URL: https://github.com/llvm/llvm-project/commit/76ce4736721a6e9030210bda6df0ad8a8f478a19
DIFF: https://github.com/llvm/llvm-project/commit/76ce4736721a6e9030210bda6df0ad8a8f478a19.diff
LOG: 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
Added:
Modified:
mlir/include/mlir/IR/OpImplementation.h
mlir/lib/IR/AsmPrinter.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/IR/OpImplementation.h b/mlir/include/mlir/IR/OpImplementation.h
index 8864ef02cd3cbba..f1fabf95a68b7ad 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<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;
diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp
index 7b0da30541b16a4..d8f2854f4efe9d9 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<Type> &result) {
+ return parseCommaSeparatedList(
+ [&]() { return parseType(result.emplace_back()); });
+ }
+
+
+
//===----------------------------------------------------------------------===//
// DialectAsmPrinter
//===----------------------------------------------------------------------===//
More information about the Mlir-commits
mailing list