[llvm-branch-commits] [llvm-branch] r99585 - /llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/GlobalOpt.cpp

Gabor Greif ggreif at gmail.com
Thu Mar 25 17:41:32 PDT 2010


Author: ggreif
Date: Thu Mar 25 19:41:32 2010
New Revision: 99585

URL: http://llvm.org/viewvc/llvm-project?rev=99585&view=rev
Log:
more constness

Modified:
    llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/GlobalOpt.cpp

Modified: llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/GlobalOpt.cpp?rev=99585&r1=99584&r2=99585&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/GlobalOpt.cpp Thu Mar 25 19:41:32 2010
@@ -140,11 +140,11 @@
 // by constants itself.  Note that constants cannot be cyclic, so this test is
 // pretty easy to implement recursively.
 //
-static bool SafeToDestroyConstant(Constant *C) {
+static bool SafeToDestroyConstant(const Constant *C) {
   if (isa<GlobalValue>(C)) return false;
 
-  for (Value::use_iterator UI = C->use_begin(), E = C->use_end(); UI != E; ++UI)
-    if (Constant *CU = dyn_cast<Constant>(*UI)) {
+  for (Value::const_use_iterator UI = C->use_begin(), E = C->use_end(); UI != E; ++UI)
+    if (const Constant *CU = dyn_cast<Constant>(*UI)) {
       if (!SafeToDestroyConstant(CU)) return false;
     } else
       return false;





More information about the llvm-branch-commits mailing list