Do not register and de-register PassRegistrationListeners during
authorZachary Turner <zturner@google.com>
Thu, 12 Jun 2014 00:16:36 +0000 (00:16 +0000)
committerZachary Turner <zturner@google.com>
Thu, 12 Jun 2014 00:16:36 +0000 (00:16 +0000)
commit39c422da57c58900eb4346cd3f69bea3e20b3ce9
tree909b1360d9ae4c35767886397b3dcaf7555e2f50
parent29d0e6b601169e99062e608dcd1dcfaf2c80a09a
Do not register and de-register PassRegistrationListeners during
construction and destruction.

PassRegistrationListener is intended for use as a generic listener.
In some cases, PassRegistrationListener-derived classes were being
created, and automatically registered and de-registered in static
constructors and destructors.  Since ManagedStatics are destroyed
prior to program shutdown, this leads to errors where an attempt is
made to access a ManagedStatic that has already been destroyed.

Reviewed by: rnk, dblaikie

Differential Revision: http://reviews.llvm.org/D4106

llvm-svn: 210724
llvm/include/llvm/IR/LegacyPassNameParser.h
llvm/include/llvm/PassSupport.h
llvm/lib/IR/Pass.cpp