[llvm] r219096 - [PM] Remove the (deeply misguided) 'unregister' functionality from the

Chandler Carruth chandlerc at gmail.com
Sun Oct 5 17:13:26 PDT 2014


Author: chandlerc
Date: Sun Oct  5 19:13:25 2014
New Revision: 219096

URL: http://llvm.org/viewvc/llvm-project?rev=219096&view=rev
Log:
[PM] Remove the (deeply misguided) 'unregister' functionality from the
pass registry.

This style of registry is somewhat questionable, but it being
non-monotonic is crazy. No one is (or should be) unloading DSOs with
passes and unregistering them here. I've checked with a few folks and
I don't know of anyone using this functionality or any important use
case where it is necessary.

Modified:
    llvm/trunk/include/llvm/PassRegistry.h
    llvm/trunk/lib/IR/PassRegistry.cpp

Modified: llvm/trunk/include/llvm/PassRegistry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassRegistry.h?rev=219096&r1=219095&r2=219096&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassRegistry.h (original)
+++ llvm/trunk/include/llvm/PassRegistry.h Sun Oct  5 19:13:25 2014
@@ -78,10 +78,6 @@ public:
   /// registry.  Required in order to use the pass with a PassManager.
   void registerPass(const PassInfo &PI, bool ShouldFree = false);
 
-  /// registerPass - Unregister a pass (by means of its PassInfo) with the
-  /// registry.
-  void unregisterPass(const PassInfo &PI);
-
   /// registerAnalysisGroup - Register an analysis group (or a pass implementing
   // an analysis group) with the registry.  Like registerPass, this is required
   // in order for a PassManager to be able to use this group/pass.

Modified: llvm/trunk/lib/IR/PassRegistry.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/PassRegistry.cpp?rev=219096&r1=219095&r2=219096&view=diff
==============================================================================
--- llvm/trunk/lib/IR/PassRegistry.cpp (original)
+++ llvm/trunk/lib/IR/PassRegistry.cpp Sun Oct  5 19:13:25 2014
@@ -70,16 +70,6 @@ void PassRegistry::registerPass(const Pa
     ToFree.push_back(std::unique_ptr<const PassInfo>(&PI));
 }
 
-void PassRegistry::unregisterPass(const PassInfo &PI) {
-  sys::SmartScopedWriter<true> Guard(Lock);
-  MapType::iterator I = PassInfoMap.find(PI.getTypeInfo());
-  assert(I != PassInfoMap.end() && "Pass registered but not in map!");
-
-  // Remove pass from the map.
-  PassInfoMap.erase(I);
-  PassInfoStringMap.erase(PI.getPassArgument());
-}
-
 void PassRegistry::enumerateWith(PassRegistrationListener *L) {
   sys::SmartScopedReader<true> Guard(Lock);
   for (auto PassInfoPair : PassInfoMap)





More information about the llvm-commits mailing list