[llvm] r195450 - [PM] Reverse the template arguments 'PassT' and 'AnalysisManagerT' in

Chandler Carruth chandlerc at gmail.com
Fri Nov 22 03:55:38 PST 2013


Author: chandlerc
Date: Fri Nov 22 05:55:38 2013
New Revision: 195450

URL: http://llvm.org/viewvc/llvm-project?rev=195450&view=rev
Log:
[PM] Reverse the template arguments 'PassT' and 'AnalysisManagerT' in
several templates. The previous order didn't make any sense as it
separated 'IRUnitT' and 'AnalysisManagerT', the types which are
essentially paired and passed along together throughout the layers.

Modified:
    llvm/trunk/include/llvm/IR/PassManager.h

Modified: llvm/trunk/include/llvm/IR/PassManager.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PassManager.h?rev=195450&r1=195449&r2=195450&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/PassManager.h (original)
+++ llvm/trunk/include/llvm/IR/PassManager.h Fri Nov 22 05:55:38 2013
@@ -169,7 +169,7 @@ template <typename IRUnitT, typename Ana
 
 /// \brief SFINAE metafunction for computing whether \c PassT has a run method
 /// accepting an \c AnalysisManagerT.
-template <typename IRUnitT, typename PassT, typename AnalysisManagerT>
+template <typename IRUnitT, typename AnalysisManagerT, typename PassT>
 class PassRunAcceptsAnalysisManager {
   typedef char SmallType;
   struct BigType { char a, b; };
@@ -189,15 +189,15 @@ public:
 /// Can be instantiated for any object which provides a \c run method accepting
 /// an \c IRUnitT. It requires the pass to be a copyable object. When the
 /// \c run method also accepts an \c AnalysisManagerT*, we pass it along.
-template <typename IRUnitT, typename PassT, typename AnalysisManagerT,
+template <typename IRUnitT, typename AnalysisManagerT, typename PassT,
           bool AcceptsAnalysisManager = PassRunAcceptsAnalysisManager<
-              IRUnitT, PassT, AnalysisManagerT>::Value>
+              IRUnitT, AnalysisManagerT, PassT>::Value>
 struct PassModel;
 
 /// \brief Specialization of \c PassModel for passes that accept an analyis
 /// manager.
-template <typename IRUnitT, typename PassT, typename AnalysisManagerT>
-struct PassModel<IRUnitT, PassT, AnalysisManagerT,
+template <typename IRUnitT, typename AnalysisManagerT, typename PassT>
+struct PassModel<IRUnitT, AnalysisManagerT, PassT,
                  true> : PassConcept<IRUnitT, AnalysisManagerT> {
   PassModel(PassT Pass) : Pass(llvm_move(Pass)) {}
   virtual PassModel *clone() { return new PassModel(Pass); }
@@ -209,8 +209,8 @@ struct PassModel<IRUnitT, PassT, Analysi
 
 /// \brief Specialization of \c PassModel for passes that accept an analyis
 /// manager.
-template <typename IRUnitT, typename PassT, typename AnalysisManagerT>
-struct PassModel<IRUnitT, PassT, AnalysisManagerT,
+template <typename IRUnitT, typename AnalysisManagerT, typename PassT>
+struct PassModel<IRUnitT, AnalysisManagerT, PassT,
                  false> : PassConcept<IRUnitT, AnalysisManagerT> {
   PassModel(PassT Pass) : Pass(llvm_move(Pass)) {}
   virtual PassModel *clone() { return new PassModel(Pass); }
@@ -370,9 +370,9 @@ private:
   typedef detail::PassConcept<Module *, ModuleAnalysisManager> ModulePassConcept;
   template <typename PassT>
   struct ModulePassModel
-      : detail::PassModel<Module *, PassT, ModuleAnalysisManager> {
+      : detail::PassModel<Module *, ModuleAnalysisManager, PassT> {
     ModulePassModel(PassT Pass)
-        : detail::PassModel<Module *, PassT, ModuleAnalysisManager>(Pass) {}
+        : detail::PassModel<Module *, ModuleAnalysisManager, PassT>(Pass) {}
   };
 
   std::vector<polymorphic_ptr<ModulePassConcept> > Passes;
@@ -396,9 +396,9 @@ private:
       FunctionPassConcept;
   template <typename PassT>
   struct FunctionPassModel
-      : detail::PassModel<Function *, PassT, FunctionAnalysisManager> {
+      : detail::PassModel<Function *, FunctionAnalysisManager, PassT> {
     FunctionPassModel(PassT Pass)
-        : detail::PassModel<Function *, PassT, FunctionAnalysisManager>(Pass) {}
+        : detail::PassModel<Function *, FunctionAnalysisManager, PassT>(Pass) {}
   };
 
   std::vector<polymorphic_ptr<FunctionPassConcept> > Passes;





More information about the llvm-commits mailing list