[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp BranchFolding.cpp MachineDebugInfo.cpp

Jim Laskey jlaskey at apple.com
Fri Jan 26 06:35:31 PST 2007



Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.139 -> 1.140
BranchFolding.cpp updated: 1.39 -> 1.40
MachineDebugInfo.cpp updated: 1.70 -> 1.71
---
Log message:

Make LABEL a builtin opcode.

---
Diffs of the changes:  (+13 -10)

 AsmPrinter.cpp       |   10 ++++++++++
 BranchFolding.cpp    |    8 ++------
 MachineDebugInfo.cpp |    5 +----
 3 files changed, 13 insertions(+), 10 deletions(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.139 llvm/lib/CodeGen/AsmPrinter.cpp:1.140
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.139	Thu Jan 25 09:12:02 2007
+++ llvm/lib/CodeGen/AsmPrinter.cpp	Fri Jan 26 08:34:51 2007
@@ -1029,6 +1029,16 @@
   O << "\n\t" << TAI->getInlineAsmEnd() << "\n";
 }
 
+/// printLabel - This method prints a local label used by debug and
+/// exception handling tables.
+void AsmPrinter::printLabel(const MachineInstr *MI) const {
+  if (AsmVerbose) O << "\n";
+  O << TAI->getPrivateGlobalPrefix()
+    << "debug_loc"
+    << MI->getOperand(0).getImmedValue()
+    << ":\n";
+}
+
 /// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
 /// instruction, using the specified assembler variant.  Targets should
 /// overried this to format as appropriate.


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.39 llvm/lib/CodeGen/BranchFolding.cpp:1.40
--- llvm/lib/CodeGen/BranchFolding.cpp:1.39	Tue Dec 19 16:41:21 2006
+++ llvm/lib/CodeGen/BranchFolding.cpp	Fri Jan 26 08:34:51 2007
@@ -74,16 +74,12 @@
   while (!MBB->succ_empty())
     MBB->removeSuccessor(MBB->succ_end()-1);
   
-  // If there is DWARF info to active, check to see if there are any DWARF_LABEL
+  // If there is DWARF info to active, check to see if there are any LABEL
   // records in the basic block.  If so, unregister them from MachineDebugInfo.
   if (MDI && !MBB->empty()) {
-    unsigned DWARF_LABELOpc = TII->getDWARF_LABELOpcode();
-    assert(DWARF_LABELOpc &&
-           "Target supports dwarf but didn't implement getDWARF_LABELOpcode!");
-    
     for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
          I != E; ++I) {
-      if ((unsigned)I->getOpcode() == DWARF_LABELOpc) {
+      if ((unsigned)I->getOpcode() == TargetInstrInfo::LABEL) {
         // The label ID # is always operand #0, an immediate.
         MDI->InvalidateLabel(I->getOperand(0).getImm());
       }


Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.70 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.71
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.70	Wed Jan 24 12:45:13 2007
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp	Fri Jan 26 08:34:51 2007
@@ -1649,9 +1649,6 @@
   // Get target instruction info.
   const TargetInstrInfo *TII = MF.getTarget().getInstrInfo();
   if (!TII) return false;
-  // Get target version of the debug label opcode.
-  unsigned DWARF_LABELOpc = TII->getDWARF_LABELOpcode();
-  if (!DWARF_LABELOpc) return false;
   
   // Track if change is made.
   bool MadeChange = false;
@@ -1664,7 +1661,7 @@
     // Iterate through instructions.
     for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
       // Is it a debug label.
-      if ((unsigned)I->getOpcode() == DWARF_LABELOpc) {
+      if ((unsigned)I->getOpcode() == TargetInstrInfo::LABEL) {
         // The label ID # is always operand #0, an immediate.
         unsigned NextLabel = I->getOperand(0).getImm();
         






More information about the llvm-commits mailing list