[llvm-branch-commits] [llvm-branch] r102586 - in /llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG: SelectionDAGBuilder.cpp SelectionDAGBuilder.h

Evan Cheng evan.cheng at apple.com
Wed Apr 28 18:46:43 PDT 2010


Author: evancheng
Date: Wed Apr 28 20:46:43 2010
New Revision: 102586

URL: http://llvm.org/viewvc/llvm-project?rev=102586&view=rev
Log:
Merge 102585.

Modified:
    llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h

Modified: llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=102586&r1=102585&r2=102586&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Apr 28 20:46:43 2010
@@ -3699,17 +3699,17 @@
 /// EmitFuncArgumentDbgValue - If the DbgValueInst is a dbg_value of a function
 /// argument, create the corresponding DBG_VALUE machine instruction for it now.
 /// At the end of instruction selection, they will be inserted to the entry BB.
-void
+bool
 SelectionDAGBuilder::EmitFuncArgumentDbgValue(const DbgValueInst &DI,
                                               const Value *V, MDNode *Variable,
                                               uint64_t Offset, SDValue &N) {
   if (!isa<Argument>(V))
-    return;
+    return false;
 
   MachineFunction &MF = DAG.getMachineFunction();
   MachineBasicBlock *MBB = FuncInfo.MBBMap[DI.getParent()];
   if (MBB != &MF.front())
-    return;
+    return false;
 
   unsigned Reg = 0;
   if (N.getOpcode() == ISD::CopyFromReg) {
@@ -3725,13 +3725,14 @@
   if (!Reg)
     Reg = FuncInfo.ValueMap[V];
   if (!Reg)
-    return;
+    return false;
 
   const TargetInstrInfo *TII = DAG.getTarget().getInstrInfo();
   MachineInstrBuilder MIB = BuildMI(MF, getCurDebugLoc(),
                                     TII->get(TargetOpcode::DBG_VALUE))
     .addReg(Reg).addImm(Offset).addMetadata(Variable);
   FuncInfo.ArgDbgValues.push_back(&*MIB);
+  return true;
 }
 
 /// visitIntrinsicCall - Lower the call to the specified intrinsic function.  If
@@ -3922,10 +3923,11 @@
     } else {
       SDValue &N = NodeMap[V];
       if (N.getNode()) {
-        EmitFuncArgumentDbgValue(DI, V, Variable, Offset, N);
-        SDV = DAG.getDbgValue(Variable, N.getNode(),
-                              N.getResNo(), Offset, dl, SDNodeOrder);
-        DAG.AddDbgValue(SDV, N.getNode(), false);
+        if (!EmitFuncArgumentDbgValue(DI, V, Variable, Offset, N)) {
+          SDV = DAG.getDbgValue(Variable, N.getNode(),
+                                N.getResNo(), Offset, dl, SDNodeOrder);
+          DAG.AddDbgValue(SDV, N.getNode(), false);
+        }
       } else {
         // We may expand this to cover more cases.  One case where we have no
         // data available is an unreferenced parameter; we need this fallback.

Modified: llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h?rev=102586&r1=102585&r2=102586&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h Wed Apr 28 20:46:43 2010
@@ -496,13 +496,15 @@
   const char *implVisitBinaryAtomic(CallInst& I, ISD::NodeType Op);
   const char *implVisitAluOverflow(CallInst &I, ISD::NodeType Op);
 
-   /// EmitFuncArgumentDbgValue - If the DbgValueInst is a dbg_value of a
-   /// function argument, create the corresponding DBG_VALUE machine instruction
-   /// for it now. At the end of instruction selection, they will be inserted to
-   /// the entry BB.
-   void EmitFuncArgumentDbgValue(const DbgValueInst &DI,
-                                 const Value *V, MDNode *Variable,
-                                 uint64_t Offset, SDValue &N);
+  void HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB);
+
+  /// EmitFuncArgumentDbgValue - If the DbgValueInst is a dbg_value of a
+  /// function argument, create the corresponding DBG_VALUE machine instruction
+  /// for it now. At the end of instruction selection, they will be inserted to
+  /// the entry BB.
+  bool EmitFuncArgumentDbgValue(const DbgValueInst &DI,
+                                const Value *V, MDNode *Variable,
+                                uint64_t Offset, SDValue &N);
 };
 
 } // end namespace llvm





More information about the llvm-branch-commits mailing list