[llvm-branch-commits] [PM] Move PassInfoMixin to detail namespace (PR #218198)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Aug 22 22:28:23 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Aiden Grossman (boomanaiden154)

<details>
<summary>Changes</summary>

To follow up on the TODO and to prevent backslide (which we have had
quite a bit of).


---
Full diff: https://github.com/llvm/llvm-project/pull/218198.diff


1 Files Affected:

- (modified) llvm/include/llvm/IR/PassManager.h (+9-10) 


``````````diff
diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h
index ca874eaf03cb6..da2eec0756c5b 100644
--- a/llvm/include/llvm/IR/PassManager.h
+++ b/llvm/include/llvm/IR/PassManager.h
@@ -68,13 +68,6 @@ template <typename DerivedT> struct InfoMixin {
     return Name;
   }
 };
-} // namespace detail
-
-class Function;
-class Module;
-
-// Forward declare the analysis manager template.
-template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager;
 
 /// A CRTP mix-in to automatically provide informational APIs needed for
 /// passes.
@@ -84,7 +77,6 @@ template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager;
 /// Actual passes should inherit from RequiredPassInfoMixin or
 /// OptionalPassInfoMixin.
 ///
-/// TODO: move to a detail namespace once we've branched for LLVM 23.
 template <typename DerivedT>
 struct PassInfoMixin : detail::InfoMixin<DerivedT> {
   void printPipeline(raw_ostream &OS,
@@ -97,16 +89,23 @@ struct PassInfoMixin : detail::InfoMixin<DerivedT> {
   // TODO: remove once out of tree users are updated.
   static bool isRequired() { return false; }
 };
+} // namespace detail
+
+class Function;
+class Module;
+
+// Forward declare the analysis manager template.
+template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager;
 
 /// A CRTP mix-in for passes that should not be skipped.
 template <typename DerivedT>
-struct RequiredPassInfoMixin : PassInfoMixin<DerivedT> {
+struct RequiredPassInfoMixin : detail::PassInfoMixin<DerivedT> {
   static bool isRequired() { return true; }
 };
 
 /// A CRTP mix-in for passes that can be skipped.
 template <typename DerivedT>
-struct OptionalPassInfoMixin : PassInfoMixin<DerivedT> {
+struct OptionalPassInfoMixin : detail::PassInfoMixin<DerivedT> {
   static bool isRequired() { return false; }
 };
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/218198


More information about the llvm-branch-commits mailing list