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

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 12 20:04:06 PDT 2016


jlebar created this revision.
jlebar added reviewers: majnemer, rnk.
jlebar added a subscriber: llvm-commits.

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.

http://reviews.llvm.org/D21274

Files:
  tools/bugpoint/CrashDebugger.cpp

Index: tools/bugpoint/CrashDebugger.cpp
===================================================================
--- tools/bugpoint/CrashDebugger.cpp
+++ 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;
       }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21274.60485.patch
Type: text/x-patch
Size: 640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160613/f0e67d3e/attachment.bin>


More information about the llvm-commits mailing list