can't just eliminate all global initializers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72378
91177308-0d34-0410-b5e6-
96231b3b80d8
// playing with...
for (Module::global_iterator I = M->global_begin(), E = M->global_end();
I != E; ++I)
// playing with...
for (Module::global_iterator I = M->global_begin(), E = M->global_end();
I != E; ++I)
- if (I->hasInitializer()) {
+ if (I->hasInitializer() && !GVSet.count(I)) {
I->setInitializer(0);
I->setLinkage(GlobalValue::ExternalLinkage);
}
I->setInitializer(0);
I->setLinkage(GlobalValue::ExternalLinkage);
}