[llvm-commits] [llvm] r41205 - /llvm/trunk/lib/VMCore/Value.cpp

Chris Lattner sabre at nondot.org
Mon Aug 20 17:21:08 PDT 2007


Author: lattner
Date: Mon Aug 20 19:21:07 2007
New Revision: 41205

URL: http://llvm.org/viewvc/llvm-project?rev=41205&view=rev
Log:
simplify code, improve a comment.

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

Modified: llvm/trunk/lib/VMCore/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Value.cpp?rev=41205&r1=41204&r2=41205&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Value.cpp (original)
+++ llvm/trunk/lib/VMCore/Value.cpp Mon Aug 20 19:21:07 2007
@@ -276,15 +276,15 @@
   while (!use_empty()) {
     Use &U = *UseList;
     // Must handle Constants specially, we cannot call replaceUsesOfWith on a
-    // constant!
+    // constant because they are uniqued.
     if (Constant *C = dyn_cast<Constant>(U.getUser())) {
-      if (!isa<GlobalValue>(C))
+      if (!isa<GlobalValue>(C)) {
         C->replaceUsesOfWithOnConstant(this, New, &U);
-      else
-        U.set(New);
-    } else {
-      U.set(New);
+        continue;
+      }
     }
+    
+    U.set(New);
   }
 }
 





More information about the llvm-commits mailing list