when debugging lower dbg intrinsics to calls
authorChris Lattner <sabre@nondot.org>
Wed, 16 Nov 2005 07:22:30 +0000 (07:22 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 16 Nov 2005 07:22:30 +0000 (07:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24377 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 01e76c1b42394d7c558db52116974f662902b257..53d97e7b7c29af8bdc95ab904a31d7b27d31f257 100644 (file)
@@ -19,6 +19,7 @@
 #include "llvm/Function.h"
 #include "llvm/Instructions.h"
 #include "llvm/Intrinsics.h"
+#include "llvm/CodeGen/IntrinsicLowering.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
@@ -780,10 +781,31 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
                             getRoot(), getValue(I.getOperand(1)),
                             getValue(I.getOperand(2))));
     return 0;
+    
   case Intrinsic::dbg_stoppoint:
+    if (TLI.getTargetMachine().getIntrinsicLowering().EmitDebugFunctions())
+      return "llvm_debugger_stop";
+    if (I.getType() != Type::VoidTy)
+      setValue(&I, DAG.getNode(ISD::UNDEF, TLI.getValueType(I.getType())));
+    return 0;
   case Intrinsic::dbg_region_start:
+    if (TLI.getTargetMachine().getIntrinsicLowering().EmitDebugFunctions())
+      return "llvm_dbg_region_start";
+    if (I.getType() != Type::VoidTy)
+      setValue(&I, DAG.getNode(ISD::UNDEF, TLI.getValueType(I.getType())));
+    return 0;
   case Intrinsic::dbg_region_end:
+    if (TLI.getTargetMachine().getIntrinsicLowering().EmitDebugFunctions())
+      return "llvm_dbg_region_end";
+    if (I.getType() != Type::VoidTy)
+      setValue(&I, DAG.getNode(ISD::UNDEF, TLI.getValueType(I.getType())));
+    return 0;
   case Intrinsic::dbg_func_start:
+    if (TLI.getTargetMachine().getIntrinsicLowering().EmitDebugFunctions())
+      return "llvm_dbg_subprogram";
+    if (I.getType() != Type::VoidTy)
+      setValue(&I, DAG.getNode(ISD::UNDEF, TLI.getValueType(I.getType())));
+    return 0;
   case Intrinsic::dbg_declare:
     if (I.getType() != Type::VoidTy)
       setValue(&I, DAG.getNode(ISD::UNDEF, TLI.getValueType(I.getType())));