OSDN Git Service

First bitcase use may not lead to a dbg.declare intrinsic. Iterate uses until one...
authorDevang Patel <dpatel@apple.com>
Thu, 29 Oct 2009 18:20:34 +0000 (18:20 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 29 Oct 2009 18:20:34 +0000 (18:20 +0000)
Patch by Sunae Seo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85518 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DebugInfo.cpp

index 1349f27..2a6e04e 100644 (file)
@@ -1304,9 +1304,10 @@ namespace llvm {
       // Look for the bitcast.
       for (Value::use_const_iterator I = V->use_begin(), E =V->use_end();
             I != E; ++I)
-        if (isa<BitCastInst>(I))
-          return findDbgDeclare(*I, false);
-
+        if (isa<BitCastInst>(I)) {
+          const DbgDeclareInst *DDI = findDbgDeclare(*I, false);
+          if (DDI) return DDI;
+        }
       return 0;
     }