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)
commita4dc93e6b620c1191f6c914f829cc23b77726bc5
treee36e26fb1de314d3f749d6b9889851f7aae80488
parent87fcb536ab8e70f3578c88c57d12c2ffee86abd2
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210724 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/LegacyPassNameParser.h
include/llvm/PassSupport.h
lib/IR/Pass.cpp