From 156bcf3f65c9d36dabc1b86e341d5ee08c24a33e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 18 Apr 2003 04:34:29 +0000 Subject: [PATCH] Global constants CAN be external git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5808 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/ConstantMerge.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Transforms/IPO/ConstantMerge.cpp b/lib/Transforms/IPO/ConstantMerge.cpp index a73fca2b3c5..0774cf28942 100644 --- a/lib/Transforms/IPO/ConstantMerge.cpp +++ b/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... -- 2.34.1