mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 15:51:54 +00:00
Global constants CAN be external
llvm-svn: 5808
This commit is contained in:
parent
8453f87c9c
commit
08b5392e07
@ -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...
|
||||
|
Loading…
x
Reference in New Issue
Block a user