[llvm] [llvm] Remove CV-qualified base class in PassManagerInternal.h (PR #124193)

Henry Jiang via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 14:23:54 PST 2025


https://github.com/mustartt updated https://github.com/llvm/llvm-project/pull/124193

>From ba384c137a0b3712304a2114c372c8112e4438f9 Mon Sep 17 00:00:00 2001
From: Henry Jiang <henry.jiang1 at ibm.com>
Date: Thu, 23 Jan 2025 14:57:17 -0500
Subject: [PATCH 1/2] remove cv qualified base class

---
 llvm/include/llvm/IR/PassManagerInternal.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/include/llvm/IR/PassManagerInternal.h b/llvm/include/llvm/IR/PassManagerInternal.h
index 4ada6ee5dd6831..4b6fad9b417889 100644
--- a/llvm/include/llvm/IR/PassManagerInternal.h
+++ b/llvm/include/llvm/IR/PassManagerInternal.h
@@ -23,6 +23,7 @@
 #include "llvm/Support/raw_ostream.h"
 #include <memory>
 #include <utility>
+#include <type_traits>
 
 namespace llvm {
 
@@ -167,7 +168,7 @@ template <typename IRUnitT, typename ResultT> class ResultHasInvalidateMethod {
   // ambiguous if there were an invalidate member in the result type.
   template <typename T, typename U> static DisabledType NonceFunction(T U::*);
   struct CheckerBase { int invalidate; };
-  template <typename T> struct Checker : CheckerBase, T {};
+  template <typename T> struct Checker : CheckerBase, std::remove_cv_t<T> {};
   template <typename T>
   static decltype(NonceFunction(&Checker<T>::invalidate)) check(rank<1>);
 

>From 3ee460834ceb5079c38d58980554da58405ccb2a Mon Sep 17 00:00:00 2001
From: Henry Jiang <h243jian at uwaterloo.ca>
Date: Thu, 23 Jan 2025 17:23:46 -0500
Subject: [PATCH 2/2] Format

---
 llvm/include/llvm/IR/PassManagerInternal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/IR/PassManagerInternal.h b/llvm/include/llvm/IR/PassManagerInternal.h
index 4b6fad9b417889..62bede206da50d 100644
--- a/llvm/include/llvm/IR/PassManagerInternal.h
+++ b/llvm/include/llvm/IR/PassManagerInternal.h
@@ -22,8 +22,8 @@
 #include "llvm/IR/Analysis.h"
 #include "llvm/Support/raw_ostream.h"
 #include <memory>
-#include <utility>
 #include <type_traits>
+#include <utility>
 
 namespace llvm {
 



More information about the llvm-commits mailing list