[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCISelLowering.cpp PPCInstrInfo.td

Jim Laskey jlaskey at apple.com
Wed Jan 4 17:25:43 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCAsmPrinter.cpp updated: 1.135 -> 1.136
PPCISelLowering.cpp updated: 1.56 -> 1.57
PPCInstrInfo.td updated: 1.168 -> 1.169
---
Log message:

Added initial support for DEBUG_LABEL allowing debug specific labels to be
inserted in the code.


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

 PPCAsmPrinter.cpp   |    6 +++++-
 PPCISelLowering.cpp |    5 ++++-
 PPCInstrInfo.td     |   11 +++++++----
 3 files changed, 16 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.135 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.136
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.135	Wed Jan  4 16:28:25 2006
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp	Wed Jan  4 19:25:28 2006
@@ -252,7 +252,9 @@
     bool doFinalization(Module &M);
     
     void getAnalysisUsage(AnalysisUsage &AU) const {
+      AU.setPreservesAll();
       AU.addRequired<MachineDebugInfo>();
+      PPCAsmPrinter::getAnalysisUsage(AU);
     }
 
   };
@@ -418,6 +420,9 @@
 /// method to print assembly for each instruction.
 ///
 bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+  // FIXME - is this the earliest this can be set.
+  DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+
   SetupMachineFunction(MF);
   O << "\n\n";
   
@@ -486,7 +491,6 @@
   Mang->setUseQuotes(true);
   
   // Emit initial debug information.
-  DW.SetDebugInfo(getAnalysisToUpdate<MachineDebugInfo>());
   DW.BeginModule();
   return false;
 }


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.56 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.57
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.56	Thu Dec 29 18:11:07 2005
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Wed Jan  4 19:25:28 2006
@@ -94,8 +94,11 @@
   // PowerPC does not have truncstore for i1.
   setOperationAction(ISD::TRUNCSTORE, MVT::i1, Promote);
 
-  // PowerPC doesn't have line number support yet.
+  // Support label based line numbers.
   setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+  // FIXME - use subtarget debug flags
+  if (TM.getSubtarget<PPCSubtarget>().isDarwin())
+    setOperationAction(ISD::DEBUG_LABEL, MVT::Other, Expand);
   
   // We want to legalize GlobalAddress and ConstantPool nodes into the 
   // appropriate instructions to materialize the address.


Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td
diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.168 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.169
--- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.168	Wed Jan  4 09:04:11 2006
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.td	Wed Jan  4 19:25:28 2006
@@ -955,11 +955,14 @@
 // DWARF Pseudo Instructions
 //
 
-def DWARF_LOC        : Pseudo<(ops i32imm:$line, i32imm:$col, i32imm:$file,
-                                   i32imm:$id),
-                              "; .loc $file, $line, $col\nLdebug_loc$id:",
+def DWARF_LOC        : Pseudo<(ops i32imm:$line, i32imm:$col, i32imm:$file),
+                              "; .loc $file, $line, $col",
                       [(dwarf_loc (i32 imm:$line), (i32 imm:$col),
-                                  (i32 imm:$file), (i32 imm:$id))]>;
+                                  (i32 imm:$file))]>;
+
+def DWARF_LABEL      : Pseudo<(ops i32imm:$id),
+                              "\nLdebug_loc$id:",
+                      [(dwarf_label (i32 imm:$id))]>;
 
 //===----------------------------------------------------------------------===//
 // PowerPC Instruction Patterns






More information about the llvm-commits mailing list