[llvm-commits] [llvm] r114986 - /llvm/trunk/lib/VMCore/Metadata.cpp
Dan Gohman
gohman at apple.com
Tue Sep 28 14:02:55 PDT 2010
Author: djg
Date: Tue Sep 28 16:02:55 2010
New Revision: 114986
URL: http://llvm.org/viewvc/llvm-project?rev=114986&view=rev
Log:
Scope a varible inside an if statement, to make it clear that
it's not used afterwards.
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=114986&r1=114985&r2=114986&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Tue Sep 28 16:02:55 2010
@@ -343,9 +343,7 @@
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);
More information about the llvm-commits
mailing list