Make debugging output with -print-machineinstrs more useful: always print out
authorBrian Gaeke <gaeke@uiuc.edu>
Fri, 28 May 2004 19:33:59 +0000 (19:33 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Fri, 28 May 2004 19:33:59 +0000 (19:33 +0000)
the transformed LLVM code which is the input to the instruction selector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13879 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9TargetMachine.cpp

index 06efeb31e256729000176178f88e9ab40486b42d..c088317cbdad7fc4542d5d54805336c52cef3859 100644 (file)
@@ -149,6 +149,11 @@ SparcV9TargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out
   PM.add(createLICMPass());
   PM.add(createGCSEPass());
 
+  // If the user's trying to read the generated code, they'll need to see the
+  // transformed input.
+  if (PrintMachineCode)
+    PM.add(new PrintModulePass());
+
   // Construct and initialize the MachineFunction object for this fn.
   PM.add(createMachineCodeConstructionPass(*this));