From: Chandler Carruth Date: Wed, 20 Jan 2010 06:01:02 +0000 (+0000) Subject: Fix the conditions to unambiguously show the logic they represent. This is the X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9520cc2eae199f8974d5ed4f89ec43468be8f128;p=oota-llvm.git Fix the conditions to unambiguously show the logic they represent. This is the logic enforced in the test case as well, so hopefully it is correct. Please review Victor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93980 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp index 822dbd9521d..b4a981f3a02 100644 --- a/lib/VMCore/Metadata.cpp +++ b/lib/VMCore/Metadata.cpp @@ -159,10 +159,10 @@ const Function *MDNode::getFunction() const { for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { if (Value *V = getOperand(i)) { - if (MDNode *MD = dyn_cast(V)) + if (MDNode *MD = dyn_cast(V)) { if (const Function *F = MD->getFunction()) return F; - else - return getFunctionForValue(V); + else return getFunctionForValue(V); + } } } return NULL;