[llvm] r225785 - [PM] In the PassManager template, remove a pointless indirection through

Chandler Carruth chandlerc at gmail.com
Tue Jan 13 03:36:43 PST 2015


Author: chandlerc
Date: Tue Jan 13 05:36:43 2015
New Revision: 225785

URL: http://llvm.org/viewvc/llvm-project?rev=225785&view=rev
Log:
[PM] In the PassManager template, remove a pointless indirection through
a nested class template for the PassModel, and use the T-suffix for the
two typedefs to match the code in the AnalysisManager.

This is the last of the fairly fundamental code cleanups here. Will be
focusing on the printing of analyses next to finish that aspect off.

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=225785&r1=225784&r2=225785&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/PassManager.h (original)
+++ llvm/trunk/include/llvm/IR/PassManager.h Tue Jan 13 05:36:43 2015
@@ -236,24 +236,19 @@ public:
   }
 
   template <typename PassT> void addPass(PassT Pass) {
-    Passes.emplace_back(new PassModel<PassT>(std::move(Pass)));
+    typedef detail::PassModel<IRUnitT, PassT> PassModelT;
+    Passes.emplace_back(new PassModelT(std::move(Pass)));
   }
 
   static StringRef name() { return "PassManager"; }
 
 private:
-  // Pull in the concept type and model template specialized for modules.
-  typedef detail::PassConcept<IRUnitT> PassConcept;
-  template <typename PassT>
-  struct PassModel : detail::PassModel<IRUnitT, PassT> {
-    PassModel(PassT Pass)
-        : detail::PassModel<IRUnitT, PassT>(std::move(Pass)) {}
-  };
+  typedef detail::PassConcept<IRUnitT> PassConceptT;
 
   PassManager(const PassManager &) LLVM_DELETED_FUNCTION;
   PassManager &operator=(const PassManager &) LLVM_DELETED_FUNCTION;
 
-  std::vector<std::unique_ptr<PassConcept>> Passes;
+  std::vector<std::unique_ptr<PassConceptT>> Passes;
 };
 
 /// \brief Convenience typedef for a pass manager over modules.





More information about the llvm-commits mailing list