diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-06-26 21:33:36 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-06-26 21:33:36 +0000 |
commit | 275c85f1a7d04cf1dc6c166211dc2d72fea43c0d (patch) | |
tree | e4d796bad2b61ad0833f1529aef4bd3233190e52 | |
parent | 1f7a1b68a07ea6bdf521525a7928f4a8c5216713 (diff) |
Fix llc's -print-before=pass and -print-after=pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159227 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CodeGen/Generic/print-after.ll | 6 | ||||
-rw-r--r-- | tools/llc/llc.cpp | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGen/Generic/print-after.ll b/test/CodeGen/Generic/print-after.ll new file mode 100644 index 0000000000..0c4695dce5 --- /dev/null +++ b/test/CodeGen/Generic/print-after.ll @@ -0,0 +1,6 @@ +; RUN: not llc --help-hidden |& FileCheck %s + +; CHECK: -print-after +; CHECK-NOT: -print-after-all +; CHECK: =simple-register-coalescing +; CHECK: -print-after-all diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 44f83e1b30..9b3ef8144c 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -353,6 +353,10 @@ int main(int argc, char **argv) { InitializeAllAsmPrinters(); InitializeAllAsmParsers(); + // Initialize codegen so that the -print-after and -print-before options + // work. + initializeCodeGen(*PassRegistry::getPassRegistry()); + // Register the target printer for --version. cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion); |