[llvm-commits] CVS: llvm/lib/Target/SparcV8/SparcV8TargetMachine.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Thu Mar 4 13:34:02 PST 2004


Changes in directory llvm/lib/Target/SparcV8:

SparcV8TargetMachine.cpp updated: 1.5 -> 1.6

---
Log message:

Support -print-machineinstrs


---
Diffs of the changes:  (+9 -6)

Index: llvm/lib/Target/SparcV8/SparcV8TargetMachine.cpp
diff -u llvm/lib/Target/SparcV8/SparcV8TargetMachine.cpp:1.5 llvm/lib/Target/SparcV8/SparcV8TargetMachine.cpp:1.6
--- llvm/lib/Target/SparcV8/SparcV8TargetMachine.cpp:1.5	Thu Mar  4 00:00:41 2004
+++ llvm/lib/Target/SparcV8/SparcV8TargetMachine.cpp	Thu Mar  4 13:22:16 2004
@@ -42,19 +42,22 @@
 					       std::ostream &Out) {
   PM.add(createSparcV8SimpleInstructionSelector(*this));
 
-  // Print machine instructions as they are created.
-  PM.add(createMachineFunctionPrinterPass(&std::cerr));
+  // Print machine instructions as they were initially generated.
+  if (PrintMachineCode)
+    PM.add(createMachineFunctionPrinterPass(&std::cerr));
 
   PM.add(createRegisterAllocator());
   PM.add(createPrologEpilogCodeInserter());
-  // <insert assembly code output passes here>
 
-  // This is not a correct asm writer by any means, but at least we see what we
-  // are producing.
-  PM.add(createMachineFunctionPrinterPass(&Out));
+  // Print machine instructions after register allocation and prolog/epilog
+  // insertion.
+  if (PrintMachineCode)
+    PM.add(createMachineFunctionPrinterPass(&std::cerr));
 
+  // Output assembly language.
   PM.add(createSparcV8CodePrinterPass(Out, *this));
 
+  // Delete the MachineInstrs we generated, since they're no longer needed.
   PM.add(createMachineCodeDeleter());
   return false;
 }





More information about the llvm-commits mailing list