If a PHI node somehow has debug info, propogate it to the MachineInstr PHI.
authorDan Gohman <gohman@apple.com>
Tue, 20 Apr 2010 14:48:02 +0000 (14:48 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 20 Apr 2010 14:48:02 +0000 (14:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101901 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp

index 704b63356a799643b4d62cc0efa678b405fccb57..8ca25bb995a245fe013cb585498ac6837ec304c0 100644 (file)
@@ -211,11 +211,11 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
 
     // Create Machine PHI nodes for LLVM PHI nodes, lowering them as
     // appropriate.
-    DebugLoc DL;
     for (BasicBlock::const_iterator I = BB->begin();
          const PHINode *PN = dyn_cast<PHINode>(I); ++I) {
       if (PN->use_empty()) continue;
 
+      DebugLoc DL = PN->getDebugLoc();
       unsigned PHIReg = ValueMap[PN];
       assert(PHIReg && "PHI node does not have an assigned virtual register!");