[llvm] [NewPM] Add deduction guide to `MFPropsModifier` to suppress warning (PR #96384)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 22 02:52:26 PDT 2024


https://github.com/paperchalice created https://github.com/llvm/llvm-project/pull/96384

Buildbot `clang-ppc64le-rhel` failed with:
```sh
error: 'MFPropsModifier' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
note: add a deduction guide to suppress this warning
```
after #94854. This PR adds deduction guide explicitly to suppress warning.

>From fe6d90bec6655023b6921097e8c1a4c6024d1cf4 Mon Sep 17 00:00:00 2001
From: PaperChalice <liujunchang97 at outlook.com>
Date: Sat, 22 Jun 2024 17:47:33 +0800
Subject: [PATCH] [NewPM] Add deduction guide to suppress warning

---
 llvm/include/llvm/CodeGen/MachinePassManager.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/llvm/include/llvm/CodeGen/MachinePassManager.h b/llvm/include/llvm/CodeGen/MachinePassManager.h
index 8c4a70493383a..253fabdac0019 100644
--- a/llvm/include/llvm/CodeGen/MachinePassManager.h
+++ b/llvm/include/llvm/CodeGen/MachinePassManager.h
@@ -99,6 +99,10 @@ template <typename PassT> class MFPropsModifier {
       is_detected<has_get_cleared_properties_t, T>::value;
 };
 
+// Additional deduction guide to suppress warning.
+template <typename PassT>
+MFPropsModifier(PassT &P, MachineFunction &MF) -> MFPropsModifier<PassT>;
+
 using MachineFunctionAnalysisManagerModuleProxy =
     InnerAnalysisManagerProxy<MachineFunctionAnalysisManager, Module>;
 



More information about the llvm-commits mailing list