[llvm-commits] [llvm] r93980 - /llvm/trunk/lib/VMCore/Metadata.cpp

Chandler Carruth chandlerc at gmail.com
Tue Jan 19 22:01:03 PST 2010


Author: chandlerc
Date: Wed Jan 20 00:01:02 2010
New Revision: 93980

URL: http://llvm.org/viewvc/llvm-project?rev=93980&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/VMCore/Metadata.cpp

Modified: llvm/trunk/lib/VMCore/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=93980&r1=93979&r2=93980&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Wed Jan 20 00:01:02 2010
@@ -159,10 +159,10 @@
 
   for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
     if (Value *V = getOperand(i)) {
-      if (MDNode *MD = dyn_cast<MDNode>(V))
+      if (MDNode *MD = dyn_cast<MDNode>(V)) {
         if (const Function *F = MD->getFunction()) return F;
-      else
-        return getFunctionForValue(V);
+        else return getFunctionForValue(V);
+      }
     }
   }
   return NULL;





More information about the llvm-commits mailing list