diff options
author | Dan Gohman <gohman@apple.com> | 2010-09-28 21:02:55 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-09-28 21:02:55 +0000 |
commit | f375ebeed674ccf850d6647a3aaa979e4621896d (patch) | |
tree | 3a5e85909b1d46b027ff283281130db442885736 /lib | |
parent | 7571ee7885e270192a5f1b945c94c342d45e56f8 (diff) | |
download | external_llvm-f375ebeed674ccf850d6647a3aaa979e4621896d.zip external_llvm-f375ebeed674ccf850d6647a3aaa979e4621896d.tar.gz external_llvm-f375ebeed674ccf850d6647a3aaa979e4621896d.tar.bz2 |
Scope a varible inside an if statement, to make it clear that
it's not used afterwards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114986 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Metadata.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp index da69c43..162884c 100644 --- a/lib/VMCore/Metadata.cpp +++ b/lib/VMCore/Metadata.cpp @@ -343,9 +343,7 @@ void MDNode::replaceOperand(MDNodeOperand *Op, Value *To) { FoldingSetNodeID ID; Profile(ID); void *InsertPoint; - MDNode *N = pImpl->MDNodeSet.FindNodeOrInsertPos(ID, InsertPoint); - - if (N) { + if (MDNode *N = pImpl->MDNodeSet.FindNodeOrInsertPos(ID, InsertPoint)) { N->replaceAllUsesWith(this); N->destroy(); N = pImpl->MDNodeSet.FindNodeOrInsertPos(ID, InsertPoint); |