diff options
author | Victor Hernandez <vhernandez@apple.com> | 2010-01-20 06:22:33 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2010-01-20 06:22:33 +0000 |
commit | 6f8694b272ffbd5b4746feccd4866bf89794fe86 (patch) | |
tree | bf49419fc1181525e23f52f3fb8c967981cf65d2 | |
parent | 9520cc2eae199f8974d5ed4f89ec43468be8f128 (diff) | |
download | external_llvm-6f8694b272ffbd5b4746feccd4866bf89794fe86.zip external_llvm-6f8694b272ffbd5b4746feccd4866bf89794fe86.tar.gz external_llvm-6f8694b272ffbd5b4746feccd4866bf89794fe86.tar.bz2 |
Fix if/else brackets; getFunctionForValue() is to be called for non-metadata values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93984 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/Metadata.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp index b4a981f..acc3b8e 100644 --- a/lib/VMCore/Metadata.cpp +++ b/lib/VMCore/Metadata.cpp @@ -122,6 +122,7 @@ MDNode::~MDNode() { } 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 @@ const Function *MDNode::getFunction() const { 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); } } } |