Summary:
This is necessary to keep the verifier happy after bugpoint removes an
initializer from a global variable with a comdat annotation, because
globals without initializers may not have comdats.
Reviewers: majnemer, rnk
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D21274
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272854
91177308-0d34-0410-b5e6-
96231b3b80d8
if (I.hasInitializer() && !GVSet.count(&I)) {
DeleteGlobalInitializer(&I);
I.setLinkage(GlobalValue::ExternalLinkage);
+ I.setComdat(nullptr);
}
// Try running the hacked up program...
if (I->hasInitializer()) {
DeleteGlobalInitializer(&*I);
I->setLinkage(GlobalValue::ExternalLinkage);
+ I->setComdat(nullptr);
DeletedInit = true;
}
//
void llvm::DeleteFunctionBody(Function *F) {
eliminateAliases(F);
+ // Function declarations can't have comdats.
+ F->setComdat(nullptr);
// delete the body of the function...
F->deleteBody();