[llvm-commits] [llvm] r152880 - in /llvm/trunk: lib/Analysis/DebugInfo.cpp test/DebugInfo/bug_null_debuginfo.ll

Eric Christopher echristo at apple.com
Thu Mar 15 17:21:55 PDT 2012


Author: echristo
Date: Thu Mar 15 19:21:54 2012
New Revision: 152880

URL: http://llvm.org/viewvc/llvm-project?rev=152880&view=rev
Log:
Do the right thing on NULL uint64 fields.

Patch by Clemens Hammacher!

Fixes PR12243

Added:
    llvm/trunk/test/DebugInfo/bug_null_debuginfo.ll
Modified:
    llvm/trunk/lib/Analysis/DebugInfo.cpp

Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=152880&r1=152879&r2=152880&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Thu Mar 15 19:21:54 2012
@@ -68,7 +68,7 @@
     return 0;
 
   if (Elt < DbgNode->getNumOperands())
-    if (ConstantInt *CI = dyn_cast<ConstantInt>(DbgNode->getOperand(Elt)))
+    if (ConstantInt *CI = dyn_cast_or_null<ConstantInt>(DbgNode->getOperand(Elt)))
       return CI->getZExtValue();
 
   return 0;

Added: llvm/trunk/test/DebugInfo/bug_null_debuginfo.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/bug_null_debuginfo.ll?rev=152880&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/bug_null_debuginfo.ll (added)
+++ llvm/trunk/test/DebugInfo/bug_null_debuginfo.ll Thu Mar 15 19:21:54 2012
@@ -0,0 +1,6 @@
+; RUN: llc
+
+
+!llvm.dbg.cu = !{!0}
+
+!0 = metadata !{null, null, null}





More information about the llvm-commits mailing list