From 275c85f1a7d04cf1dc6c166211dc2d72fea43c0d Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 26 Jun 2012 21:33:36 +0000 Subject: [PATCH] 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 --- test/CodeGen/Generic/print-after.ll | 6 ++++++ tools/llc/llc.cpp | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 test/CodeGen/Generic/print-after.ll diff --git a/test/CodeGen/Generic/print-after.ll b/test/CodeGen/Generic/print-after.ll new file mode 100644 index 00000000000..0c4695dce56 --- /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 44f83e1b307..9b3ef8144c8 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);