[llvm-commits] [llvm] r99997 - /llvm/trunk/lib/Analysis/DebugInfo.cpp

Chris Lattner sabre at nondot.org
Tue Mar 30 22:53:47 PDT 2010


Author: lattner
Date: Wed Mar 31 00:53:47 2010
New Revision: 99997

URL: http://llvm.org/viewvc/llvm-project?rev=99997&view=rev
Log:
microoptimize this hot method, also making it more 
consistent with other similar ones.

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=99997&r1=99996&r2=99997&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Wed Mar 31 00:53:47 2010
@@ -96,9 +96,8 @@
   if (DbgNode == 0)
     return DIDescriptor();
 
-  if (Elt < DbgNode->getNumOperands() && DbgNode->getOperand(Elt))
-    return DIDescriptor(dyn_cast<MDNode>(DbgNode->getOperand(Elt)));
-
+  if (Elt < DbgNode->getNumOperands())
+    return DIDescriptor(dyn_cast_or_null<MDNode>(DbgNode->getOperand(Elt)));
   return DIDescriptor();
 }
 





More information about the llvm-commits mailing list