[llvm-commits] [llvm] r93984 - /llvm/trunk/lib/VMCore/Metadata.cpp
Victor Hernandez
vhernandez at apple.com
Tue Jan 19 22:22:33 PST 2010
Author: hernande
Date: Wed Jan 20 00:22:33 2010
New Revision: 93984
URL: http://llvm.org/viewvc/llvm-project?rev=93984&view=rev
Log:
Fix if/else brackets; getFunctionForValue() is to be called for non-metadata values
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=93984&r1=93983&r2=93984&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Wed Jan 20 00:22:33 2010
@@ -122,6 +122,7 @@
}
static const Function *getFunctionForValue(Value *V) {
+ assert(!isa<MDNode>(V) && "does not iterate over metadata operands");
if (!V) return NULL;
if (Instruction *I = dyn_cast<Instruction>(V))
return I->getParent()->getParent();
@@ -161,7 +162,8 @@
if (Value *V = getOperand(i)) {
if (MDNode *MD = dyn_cast<MDNode>(V)) {
if (const Function *F = MD->getFunction()) return F;
- else return getFunctionForValue(V);
+ } else {
+ return getFunctionForValue(V);
}
}
}
More information about the llvm-commits
mailing list