From d6514b1e13dd87b9790c3eed70cdb82157d59392 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 20 Jan 2010 06:01:02 +0000 Subject: [PATCH] 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. llvm-svn: 93980 --- llvm/lib/VMCore/Metadata.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/VMCore/Metadata.cpp b/llvm/lib/VMCore/Metadata.cpp index 822dbd9521d2..b4a981f3a026 100644 --- a/llvm/lib/VMCore/Metadata.cpp +++ b/llvm/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; -- GitLab