Ignore DBG_VALUE instructions that points to undef values.
authorDevang Patel <dpatel@apple.com>
Tue, 27 Apr 2010 20:54:45 +0000 (20:54 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 27 Apr 2010 20:54:45 +0000 (20:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102463 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index f7b4c09162affe16e7a9a773ef0991278985ea9a..8cdb94c152a26a1dfd8bb49284e618af4f509a69 100644 (file)
@@ -2081,6 +2081,11 @@ void DwarfDebug::collectVariableInfo() {
       // FIXME : Lift this restriction.
       if (MInsn->getNumOperands() != 3)
         continue;
+
+      // Ignore Undef values.
+      if (!MInsn->getOperand(0).getReg())
+        continue;
+
       DIVariable DV(
         const_cast<MDNode *>(MInsn->getOperand(MInsn->getNumOperands() - 1)
                                .getMetadata()));
index 9d239c1bd7cfc515da0531907d58604a16941d94..d663521abaf24b100569c14c5f8c2d4b7a1c31be 100644 (file)
@@ -3834,15 +3834,10 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
         return 0;
       DAG.AddDbgValue(SDV, N.getNode(), isParameter);
     } else {
-      // Generating Undefs here seems to be actively harmful because it
-      // affects the line numbers.
-      return 0;
-#if 0
       // This isn't useful, but it shows what we're missing.
       SDV = DAG.getDbgValue(Variable, UndefValue::get(Address->getType()),
                             0, dl, SDNodeOrder);
       DAG.AddDbgValue(SDV, 0, isParameter);
-#endif
     }
     return 0;
   }