Patch for PR23472

Yaron Keren via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 3 11:04:33 PDT 2015


http://llvm.org/pr23472

As suggested by Reid, OK to commit?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150903/cfb2a457/attachment.html>
-------------- next part --------------
Index: tools/clang/lib/CodeGen/ItaniumCXXABI.cpp
===================================================================
--- tools/clang/lib/CodeGen/ItaniumCXXABI.cpp	(revision 246575)
+++ tools/clang/lib/CodeGen/ItaniumCXXABI.cpp	(working copy)
@@ -1826,7 +1826,8 @@
     // The ABI says: It is suggested that it be emitted in the same COMDAT group
     // as the associated data object
     llvm::Comdat *C = var->getComdat();
-    if (!D.isLocalVarDecl() && C) {
+    if (!D.isLocalVarDecl() && C &&
+        CGM.getTarget().getTriple().isOSBinFormatELF()) {
       guard->setComdat(C);
       CGF.CurFn->setComdat(C);
     } else if (CGM.supportsCOMDAT() && guard->isWeakForLinker()) {


More information about the cfe-commits mailing list