[Mlir-commits] [mlir] [MLIR][NFC] Fix build on recent GCC with C++20 enabled (PR #73308)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Nov 24 01:54:20 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-spirv
@llvm/pr-subscribers-mlir
Author: Alexander Batashev (alexbatashev)
<details>
<summary>Changes</summary>
The following pattern fails on recent GCC versions with -std=c++20 flag passed and succeeds with -std=c++17. Such behavior is not observed on Clang 16.0.
```
template <typename T>
struct Foo {
Foo<T>(int a) {}
};
```
This patch removes template parameter from constructor in two occurences to make the following command complete successfully:
bazel build -c fastbuild --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 @<!-- -->llvm-project//mlir/...
This patch is similar to https://reviews.llvm.org/D154782
---
Full diff: https://github.com/llvm/llvm-project/pull/73308.diff
4 Files Affected:
- (modified) mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp (+2-4)
- (modified) mlir/lib/Conversion/MathToLibm/MathToLibm.cpp (+2-2)
- (modified) mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp (+2-2)
- (modified) mlir/lib/Pass/PassRegistry.cpp (+1-1)
``````````diff
diff --git a/mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp b/mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp
index 3b8338673a5e32e..b3762f0293492ca 100644
--- a/mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp
+++ b/mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp
@@ -55,10 +55,8 @@ template <typename Op, typename TypeResolver = ComplexTypeResolver>
struct ScalarOpToLibmCall : public OpRewritePattern<Op> {
public:
using OpRewritePattern<Op>::OpRewritePattern;
- ScalarOpToLibmCall<Op, TypeResolver>(MLIRContext *context,
- StringRef floatFunc,
- StringRef doubleFunc,
- PatternBenefit benefit)
+ ScalarOpToLibmCall(MLIRContext *context, StringRef floatFunc,
+ StringRef doubleFunc, PatternBenefit benefit)
: OpRewritePattern<Op>(context, benefit), floatFunc(floatFunc),
doubleFunc(doubleFunc){};
diff --git a/mlir/lib/Conversion/MathToLibm/MathToLibm.cpp b/mlir/lib/Conversion/MathToLibm/MathToLibm.cpp
index 7fd94116ef7a6eb..103c1fb8c3822ec 100644
--- a/mlir/lib/Conversion/MathToLibm/MathToLibm.cpp
+++ b/mlir/lib/Conversion/MathToLibm/MathToLibm.cpp
@@ -50,8 +50,8 @@ template <typename Op>
struct ScalarOpToLibmCall : public OpRewritePattern<Op> {
public:
using OpRewritePattern<Op>::OpRewritePattern;
- ScalarOpToLibmCall<Op>(MLIRContext *context, StringRef floatFunc,
- StringRef doubleFunc)
+ ScalarOpToLibmCall(MLIRContext *context, StringRef floatFunc,
+ StringRef doubleFunc)
: OpRewritePattern<Op>(context), floatFunc(floatFunc),
doubleFunc(doubleFunc){};
diff --git a/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp b/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp
index e749f2bc101297d..febfe97f6c0a997 100644
--- a/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp
+++ b/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp
@@ -96,8 +96,8 @@ Region::iterator getBlockIt(Region ®ion, unsigned index) {
template <typename OpTy>
class SCFToSPIRVPattern : public OpConversionPattern<OpTy> {
public:
- SCFToSPIRVPattern<OpTy>(MLIRContext *context, SPIRVTypeConverter &converter,
- ScfToSPIRVContextImpl *scfToSPIRVContext)
+ SCFToSPIRVPattern(MLIRContext *context, SPIRVTypeConverter &converter,
+ ScfToSPIRVContextImpl *scfToSPIRVContext)
: OpConversionPattern<OpTy>::OpConversionPattern(converter, context),
scfToSPIRVContext(scfToSPIRVContext), typeConverter(converter) {}
diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp
index b0c314369190a40..35ac4b8fd280eab 100644
--- a/mlir/lib/Pass/PassRegistry.cpp
+++ b/mlir/lib/Pass/PassRegistry.cpp
@@ -373,7 +373,7 @@ llvm::cl::OptionValue<OpPassManager>::operator=(
return *this;
}
-llvm::cl::OptionValue<OpPassManager>::~OptionValue<OpPassManager>() = default;
+llvm::cl::OptionValue<OpPassManager>::~OptionValue() = default;
void llvm::cl::OptionValue<OpPassManager>::setValue(
const OpPassManager &newValue) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/73308
More information about the Mlir-commits
mailing list