diff options
author | Chris Lattner <sabre@nondot.org> | 2003-04-18 04:34:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-04-18 04:34:29 +0000 |
commit | 424132aa57ca98c9c91efde1f7f88cc6aa6cee54 (patch) | |
tree | f6059e2233d6463c4fe4d9e6a5a5fc4bcabc3ac9 /llvm/lib/Transforms/IPO/ConstantMerge.cpp | |
parent | 56d9f7f02ad2fafd5ef5895f89110c473f7860d4 (diff) | |
download | bcm5719-llvm-424132aa57ca98c9c91efde1f7f88cc6aa6cee54.tar.gz bcm5719-llvm-424132aa57ca98c9c91efde1f7f88cc6aa6cee54.zip |
Global constants CAN be external
llvm-svn: 5808
Diffstat (limited to 'llvm/lib/Transforms/IPO/ConstantMerge.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/ConstantMerge.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/ConstantMerge.cpp b/llvm/lib/Transforms/IPO/ConstantMerge.cpp index a73fca2b3c5..0774cf28942 100644 --- a/llvm/lib/Transforms/IPO/ConstantMerge.cpp +++ b/llvm/lib/Transforms/IPO/ConstantMerge.cpp @@ -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 ConstantMerge::run(Module &M) { 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... |