diff options
author | Andrew Trick <atrick@apple.com> | 2013-09-18 23:31:16 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2013-09-18 23:31:16 +0000 |
commit | f33d6df89997d48f8ecb747431a2043b559ec88a (patch) | |
tree | 1bcfbbc9185a19895ff0cb96ba54195e377d6837 /llvm/tools/llvm-dis/llvm-dis.cpp | |
parent | dc073addc5e89601f35be20566a146cb887f2350 (diff) | |
download | bcm5719-llvm-f33d6df89997d48f8ecb747431a2043b559ec88a.tar.gz bcm5719-llvm-f33d6df89997d48f8ecb747431a2043b559ec88a.zip |
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.
llvm-svn: 190974
Diffstat (limited to 'llvm/tools/llvm-dis/llvm-dis.cpp')
-rw-r--r-- | llvm/tools/llvm-dis/llvm-dis.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp index 87eb34708a1..f31cbd4d2c3 100644 --- a/llvm/tools/llvm-dis/llvm-dis.cpp +++ b/llvm/tools/llvm-dis/llvm-dis.cpp @@ -23,6 +23,7 @@ #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Module.h" #include "llvm/IR/Type.h" +#include "llvm/PassManager.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/DataStream.h" #include "llvm/Support/FormattedStream.h" @@ -119,6 +120,8 @@ int main(int argc, char **argv) { LLVMContext &Context = getGlobalContext(); llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. + // Initialize PassManager for -time-passes support. + initializePassManager(); cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll disassembler\n"); |