From 7a2f3e0b46e18abfe63bc724380021dcc6e49363 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 31 Mar 2010 05:53:47 +0000 Subject: [PATCH] microoptimize this hot method, also making it more consistent with other similar ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99997 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DebugInfo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index fda69ac39a2..f12552d9e40 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -96,9 +96,8 @@ DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const { if (DbgNode == 0) return DIDescriptor(); - if (Elt < DbgNode->getNumOperands() && DbgNode->getOperand(Elt)) - return DIDescriptor(dyn_cast(DbgNode->getOperand(Elt))); - + if (Elt < DbgNode->getNumOperands()) + return DIDescriptor(dyn_cast_or_null(DbgNode->getOperand(Elt))); return DIDescriptor(); }