From 78c327f171219dcf214ca21be38c8d24368b9a41 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 29 Oct 2009 18:20:34 +0000 Subject: [PATCH] First bitcase use may not lead to a dbg.declare intrinsic. Iterate uses until one find's dbg.declare intrinsic. Patch by Sunae Seo. llvm-svn: 85518 --- llvm/lib/Analysis/DebugInfo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 1349f2778aab..2a6e04eb7434 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/lib/Analysis/DebugInfo.cpp @@ -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(I)) - return findDbgDeclare(*I, false); - + if (isa(I)) { + const DbgDeclareInst *DDI = findDbgDeclare(*I, false); + if (DDI) return DDI; + } return 0; }