================
@@ -656,7 +657,22 @@ static GlobalVariable *SRAGlobal(GlobalVariable *GV, const 
DataLayout &DL) {
   ++NumSRA;
 
   assert(NewGlobals.size() > 0);
-  return NewGlobals.begin()->second;
+
+  auto *FirstNewGV = NewGlobals.begin()->second;
+
+  // For COFF, the comdat must contain a member which has the
+  // same name as the group.
+  if (auto *C = FirstNewGV->getComdat()) {
+    auto *DummyGV = new GlobalVariable(
+        *FirstNewGV->getParent(), Type::getInt1Ty(FirstNewGV->getContext()),
----------------
mayanez wrote:

Done.

TIL this is valid (at least the verifier does not complain).

https://github.com/llvm/llvm-project/pull/220721
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to