mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-03 08:51:43 +00:00
[Bugpoint] Erase comdat annotations after removing a global's initializer.
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 llvm-svn: 272854
This commit is contained in:
parent
5db17e4669
commit
bb4e7aadbf
@ -164,6 +164,7 @@ ReduceCrashingGlobalVariables::TestGlobalVariables(
|
||||
if (I.hasInitializer() && !GVSet.count(&I)) {
|
||||
DeleteGlobalInitializer(&I);
|
||||
I.setLinkage(GlobalValue::ExternalLinkage);
|
||||
I.setComdat(nullptr);
|
||||
}
|
||||
|
||||
// Try running the hacked up program...
|
||||
@ -668,6 +669,7 @@ static bool DebugACrash(BugDriver &BD,
|
||||
if (I->hasInitializer()) {
|
||||
DeleteGlobalInitializer(&*I);
|
||||
I->setLinkage(GlobalValue::ExternalLinkage);
|
||||
I->setComdat(nullptr);
|
||||
DeletedInit = true;
|
||||
}
|
||||
|
||||
|
@ -215,6 +215,8 @@ void llvm::DeleteGlobalInitializer(GlobalVariable *GV) {
|
||||
//
|
||||
void llvm::DeleteFunctionBody(Function *F) {
|
||||
eliminateAliases(F);
|
||||
// Function declarations can't have comdats.
|
||||
F->setComdat(nullptr);
|
||||
|
||||
// delete the body of the function...
|
||||
F->deleteBody();
|
||||
|
Loading…
Reference in New Issue
Block a user