Encapsulate PassManager debug flags to avoid static init and cxa_exit.
authorAndrew Trick <atrick@apple.com>
Wed, 18 Sep 2013 23:31:16 +0000 (23:31 +0000)
committerAndrew Trick <atrick@apple.com>
Wed, 18 Sep 2013 23:31:16 +0000 (23:31 +0000)
commit7d4e9934e7ca83094c5cf41346966c8350179ff2
tree48b3578a2c33d22d52bbb70883fb693801051f80
parent2cccc6220cc351b52d2cd2d0b7139502e854b68d
Encapsulate PassManager debug flags to avoid static init and cxa_exit.

This puts all the global PassManager debugging flags, like
-print-after-all and -time-passes, behind a managed static. This
eliminates their static initializers and, more importantly, exit-time
destructors.

The only behavioral change I anticipate is that tools need to
initialize the PassManager before parsing the command line in order to
export these options, which makes sense. Tools that already initialize
the standard passes (opt/llc) don't need to do anything new.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190974 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/PassManager.h
lib/IR/Core.cpp
lib/IR/PassManager.cpp
tools/llvm-as/llvm-as.cpp
tools/llvm-diff/llvm-diff.cpp
tools/llvm-dis/llvm-dis.cpp
tools/llvm-extract/llvm-extract.cpp
tools/llvm-link/llvm-link.cpp
tools/llvm-nm/llvm-nm.cpp
tools/llvm-prof/llvm-prof.cpp
tools/llvm-stress/llvm-stress.cpp