[PATCH] D21274: [Bugpoint] Erase comdat annotations after removing a global's initializer.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 16:27:05 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL272854: [Bugpoint] Erase comdat annotations after removing a global's initializer. (authored by jlebar).

Changed prior to commit:
  http://reviews.llvm.org/D21274?vs=60544&id=60928#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21274

Files:
  llvm/trunk/tools/bugpoint/CrashDebugger.cpp
  llvm/trunk/tools/bugpoint/ExtractFunction.cpp

Index: llvm/trunk/tools/bugpoint/CrashDebugger.cpp
===================================================================
--- llvm/trunk/tools/bugpoint/CrashDebugger.cpp
+++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp
@@ -164,6 +164,7 @@
     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 @@
       if (I->hasInitializer()) {
         DeleteGlobalInitializer(&*I);
         I->setLinkage(GlobalValue::ExternalLinkage);
+        I->setComdat(nullptr);
         DeletedInit = true;
       }
 
Index: llvm/trunk/tools/bugpoint/ExtractFunction.cpp
===================================================================
--- llvm/trunk/tools/bugpoint/ExtractFunction.cpp
+++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp
@@ -215,6 +215,8 @@
 //
 void llvm::DeleteFunctionBody(Function *F) {
   eliminateAliases(F);
+  // Function declarations can't have comdats.
+  F->setComdat(nullptr);
 
   // delete the body of the function...
   F->deleteBody();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21274.60928.patch
Type: text/x-patch
Size: 1125 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160615/6b5cd6bd/attachment.bin>


More information about the llvm-commits mailing list