[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp

Jim Laskey jlaskey at apple.com
Wed Mar 8 11:31:28 PST 2006



Changes in directory llvm/lib/Target/CBackend:

Writer.cpp updated: 1.254 -> 1.255
---
Log message:

Add #line support for CBE.


---
Diffs of the changes:  (+17 -0)

 Writer.cpp |   17 +++++++++++++++++
 1 files changed, 17 insertions(+)


Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.254 llvm/lib/Target/CBackend/Writer.cpp:1.255
--- llvm/lib/Target/CBackend/Writer.cpp:1.254	Tue Mar  7 16:58:23 2006
+++ llvm/lib/Target/CBackend/Writer.cpp	Wed Mar  8 13:31:15 2006
@@ -1598,6 +1598,7 @@
           case Intrinsic::setjmp:
           case Intrinsic::longjmp:
           case Intrinsic::prefetch:
+          case Intrinsic::dbg_stoppoint:
             // We directly implement these intrinsics
             break;
           default:
@@ -1687,6 +1688,22 @@
         writeOperand(I.getOperand(3));
         Out << ")";
         return;
+      case Intrinsic::dbg_stoppoint: {
+        // If we use writeOperand directly we get a "u" suffix which is rejected
+        // by gcc.
+        ConstantUInt *SI = cast<ConstantUInt>(I.getOperand(2));
+        GlobalVariable *GV = cast<GlobalVariable>(I.getOperand(4));
+        ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
+        std::string FileName = CS->getOperand(4)->getStringValue();
+        std::string Directory = CS->getOperand(5)->getStringValue();
+
+        Out << "\n#line "
+            << SI->getValue()
+            << " \"" << Directory << FileName << "\"\n";
+        // Need to set result.
+        Out << "0";
+        return;
+      }
       }
     }
 






More information about the llvm-commits mailing list