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 | 7d4e9934e7ca83094c5cf41346966c8350179ff2 (patch) | |
tree | 48b3578a2c33d22d52bbb70883fb693801051f80 /tools/llvm-link | |
parent | 2cccc6220cc351b52d2cd2d0b7139502e854b68d (diff) | |
download | external_llvm-7d4e9934e7ca83094c5cf41346966c8350179ff2.zip external_llvm-7d4e9934e7ca83094c5cf41346966c8350179ff2.tar.gz external_llvm-7d4e9934e7ca83094c5cf41346966c8350179ff2.tar.bz2 |
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
Diffstat (limited to 'tools/llvm-link')
-rw-r--r-- | tools/llvm-link/llvm-link.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp index 99cca23..8e7d4b0 100644 --- a/tools/llvm-link/llvm-link.cpp +++ b/tools/llvm-link/llvm-link.cpp @@ -18,6 +18,7 @@ #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IRReader/IRReader.h" +#include "llvm/PassManager.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Path.h" @@ -73,6 +74,10 @@ 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 linker\n"); unsigned BaseArg = 0; |