[PM] Remove the (deeply misguided) 'unregister' functionality from the
authorChandler Carruth <chandlerc@gmail.com>
Mon, 6 Oct 2014 00:13:25 +0000 (00:13 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 6 Oct 2014 00:13:25 +0000 (00:13 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219096 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/PassRegistry.h
lib/IR/PassRegistry.cpp

index 327a152147c70ce9a1bd09e5e34c502f81e514d9..6233f24c5fd8a7c2a70938e6300777192f4f1d69 100644 (file)
@@ -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.
index 2d056030fa265719dc50c1b23b97de9f343ded54..2cff3ccdc23390484797d52690600f4536504b3d 100644 (file)
@@ -70,16 +70,6 @@ void PassRegistry::registerPass(const PassInfo &PI, bool ShouldFree) {
     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)