[llvm-commits] CVS: llvm/lib/Transforms/IPO/ConstantMerge.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Apr 17 23:35:01 PDT 2003


Changes in directory llvm/lib/Transforms/IPO:

ConstantMerge.cpp updated: 1.18 -> 1.19

---
Log message:

Global constants CAN be external


---
Diffs of the changes:

Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp
diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.18 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.19
--- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.18	Wed Oct  9 18:16:04 2002
+++ llvm/lib/Transforms/IPO/ConstantMerge.cpp	Thu Apr 17 23:34:29 2003
@@ -1,4 +1,4 @@
-//===- ConstantMerge.cpp - Merge duplicate global constants -----------------=//
+//===- ConstantMerge.cpp - Merge duplicate global constants ---------------===//
 //
 // This file defines the interface to a pass that merges duplicate global
 // constants together into a single constant that is shared.  This is useful
@@ -36,8 +36,8 @@
   bool MadeChanges = false;
   
   for (Module::giterator GV = M.gbegin(), E = M.gend(); GV != E; ++GV)
-    if (GV->isConstant()) {  // Only process constants
-      assert(GV->hasInitializer() && "Globals constants must have inits!");
+    // Only process constants with initializers
+    if (GV->isConstant() && GV->hasInitializer()) {
       Constant *Init = GV->getInitializer();
 
       // Check to see if the initializer is already known...





More information about the llvm-commits mailing list