[PATCH] D74631: [clang][XCOFF] Indicate that XCOFF does not support COMDATs

2020-02-18 Thread David Tenty via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG58817a0783ca: [clang][XCOFF] Indicate that XCOFF does not 
support COMDATs (authored by daltenty).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74631/new/

https://reviews.llvm.org/D74631

Files:
  clang/test/CodeGen/xcoff-comdat.cpp
  llvm/docs/LangRef.rst
  llvm/include/llvm/ADT/Triple.h


Index: llvm/include/llvm/ADT/Triple.h
===
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -743,7 +743,7 @@
 
   /// Tests whether the target supports comdat
   bool supportsCOMDAT() const {
-return !isOSBinFormatMachO();
+return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());
   }
 
   /// Tests whether the target uses emulated TLS as default.
Index: llvm/docs/LangRef.rst
===
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -910,8 +910,8 @@
 The linker may choose any COMDAT key but the sections must contain the
 same amount of data.
 
-Note that the Mach-O platform doesn't support COMDATs, and ELF and WebAssembly
-only support ``any`` as a selection kind.
+Note that XCOFF and the Mach-O platform don't support COMDATs, and ELF and
+WebAssembly only support ``any`` as a selection kind.
 
 Here is an example of a COMDAT group where a function will only be selected if
 the COMDAT key's section is the largest:
Index: clang/test/CodeGen/xcoff-comdat.cpp
===
--- /dev/null
+++ clang/test/CodeGen/xcoff-comdat.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -o - %s | FileCheck %s
+
+class a {
+  virtual void d() {}
+  virtual void e();
+};
+void a::e() {}
+
+// CHECK-NOT: = comdat


Index: llvm/include/llvm/ADT/Triple.h
===
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -743,7 +743,7 @@
 
   /// Tests whether the target supports comdat
   bool supportsCOMDAT() const {
-return !isOSBinFormatMachO();
+return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());
   }
 
   /// Tests whether the target uses emulated TLS as default.
Index: llvm/docs/LangRef.rst
===
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -910,8 +910,8 @@
 The linker may choose any COMDAT key but the sections must contain the
 same amount of data.
 
-Note that the Mach-O platform doesn't support COMDATs, and ELF and WebAssembly
-only support ``any`` as a selection kind.
+Note that XCOFF and the Mach-O platform don't support COMDATs, and ELF and
+WebAssembly only support ``any`` as a selection kind.
 
 Here is an example of a COMDAT group where a function will only be selected if
 the COMDAT key's section is the largest:
Index: clang/test/CodeGen/xcoff-comdat.cpp
===
--- /dev/null
+++ clang/test/CodeGen/xcoff-comdat.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -o - %s | FileCheck %s
+
+class a {
+  virtual void d() {}
+  virtual void e();
+};
+void a::e() {}
+
+// CHECK-NOT: = comdat
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74631: [clang][XCOFF] Indicate that XCOFF does not support COMDATs

2020-02-18 Thread Sean Fertile via Phabricator via cfe-commits
sfertile accepted this revision.
sfertile added a comment.
This revision is now accepted and ready to land.

LGTM.




Comment at: llvm/docs/LangRef.rst:913
 
-Note that the Mach-O platform doesn't support COMDATs, and ELF and WebAssembly
-only support ``any`` as a selection kind.
+Note that XCOFF and the Mach-O platform don't support COMDATs, and ELF and
+WebAssembly only support ``any`` as a selection kind.

really minor nit: The current wording sounds a bit odd to my ear. Maybe either 
`XCOFF and Mach-O platforms` or  `XCOFF and Mach-O don't support COMDATs, ...` 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74631/new/

https://reviews.llvm.org/D74631



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74631: [clang][XCOFF] Indicate that XCOFF does not support COMDATs

2020-02-18 Thread David Tenty via Phabricator via cfe-commits
daltenty updated this revision to Diff 245201.
daltenty added a comment.
Herald added subscribers: aheejin, dschuff.

- Update lang doc to indicate XCOFF doesn't support COMDAT


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74631/new/

https://reviews.llvm.org/D74631

Files:
  clang/test/CodeGen/xcoff-comdat.cpp
  llvm/docs/LangRef.rst
  llvm/include/llvm/ADT/Triple.h


Index: llvm/include/llvm/ADT/Triple.h
===
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -743,7 +743,7 @@
 
   /// Tests whether the target supports comdat
   bool supportsCOMDAT() const {
-return !isOSBinFormatMachO();
+return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());
   }
 
   /// Tests whether the target uses emulated TLS as default.
Index: llvm/docs/LangRef.rst
===
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -910,8 +910,8 @@
 The linker may choose any COMDAT key but the sections must contain the
 same amount of data.
 
-Note that the Mach-O platform doesn't support COMDATs, and ELF and WebAssembly
-only support ``any`` as a selection kind.
+Note that XCOFF and the Mach-O platform don't support COMDATs, and ELF and
+WebAssembly only support ``any`` as a selection kind.
 
 Here is an example of a COMDAT group where a function will only be selected if
 the COMDAT key's section is the largest:
Index: clang/test/CodeGen/xcoff-comdat.cpp
===
--- /dev/null
+++ clang/test/CodeGen/xcoff-comdat.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -o - %s | FileCheck %s
+
+class a {
+  virtual void d() {}
+  virtual void e();
+};
+void a::e() {}
+
+// CHECK-NOT: = comdat


Index: llvm/include/llvm/ADT/Triple.h
===
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -743,7 +743,7 @@
 
   /// Tests whether the target supports comdat
   bool supportsCOMDAT() const {
-return !isOSBinFormatMachO();
+return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());
   }
 
   /// Tests whether the target uses emulated TLS as default.
Index: llvm/docs/LangRef.rst
===
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -910,8 +910,8 @@
 The linker may choose any COMDAT key but the sections must contain the
 same amount of data.
 
-Note that the Mach-O platform doesn't support COMDATs, and ELF and WebAssembly
-only support ``any`` as a selection kind.
+Note that XCOFF and the Mach-O platform don't support COMDATs, and ELF and
+WebAssembly only support ``any`` as a selection kind.
 
 Here is an example of a COMDAT group where a function will only be selected if
 the COMDAT key's section is the largest:
Index: clang/test/CodeGen/xcoff-comdat.cpp
===
--- /dev/null
+++ clang/test/CodeGen/xcoff-comdat.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -o - %s | FileCheck %s
+
+class a {
+  virtual void d() {}
+  virtual void e();
+};
+void a::e() {}
+
+// CHECK-NOT: = comdat
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74631: [clang][XCOFF] Indicate that XCOFF does not support COMDATs

2020-02-18 Thread David Tenty via Phabricator via cfe-commits
daltenty added a comment.

In D74631#1876995 , @sfertile wrote:

> 1. We should probably update the COMDAT section of the lang ref to mention 
> XCOFF doesn't support COMDATS.


I will update the langref as suggested.

> 2. Will we report an error somewhere in the backend if we encounter a COMDAT?

As mentioned by @Xiangling_L, we will run into `report_fatal_error("COMDAT not 
yet supported by AIX.")`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74631/new/

https://reviews.llvm.org/D74631



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74631: [clang][XCOFF] Indicate that XCOFF does not support COMDATs

2020-02-14 Thread Xiangling Liao via Phabricator via cfe-commits
Xiangling_L added a comment.

In D74631#1876995 , @sfertile wrote:

>




> Will we report an error somewhere in the backend if we encounter a COMDAT?

I hit this when I was doing my static init patch as well:  `error in backend: 
COMDAT not yet supported by AIX.`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74631/new/

https://reviews.llvm.org/D74631



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74631: [clang][XCOFF] Indicate that XCOFF does not support COMDATs

2020-02-14 Thread Sean Fertile via Phabricator via cfe-commits
sfertile added a comment.

1. We should probably update the COMDAT section of the lang ref to mention 
XCOFF doens't support COMDATS.
2. Will we report an error somewhere in the backend if we encounter a COMDAT?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74631/new/

https://reviews.llvm.org/D74631



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74631: [clang][XCOFF] Indicate that XCOFF does not support COMDATs

2020-02-14 Thread David Tenty via Phabricator via cfe-commits
daltenty updated this revision to Diff 244708.
daltenty added a comment.

- Add missing newline


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74631/new/

https://reviews.llvm.org/D74631

Files:
  clang/test/CodeGen/xcoff-comdat.cpp
  llvm/include/llvm/ADT/Triple.h


Index: llvm/include/llvm/ADT/Triple.h
===
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -743,7 +743,7 @@
 
   /// Tests whether the target supports comdat
   bool supportsCOMDAT() const {
-return !isOSBinFormatMachO();
+return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());
   }
 
   /// Tests whether the target uses emulated TLS as default.
Index: clang/test/CodeGen/xcoff-comdat.cpp
===
--- /dev/null
+++ clang/test/CodeGen/xcoff-comdat.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -o - %s | FileCheck %s
+
+class a {
+  virtual void d() {}
+  virtual void e();
+};
+void a::e() {}
+
+// CHECK-NOT: = comdat


Index: llvm/include/llvm/ADT/Triple.h
===
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -743,7 +743,7 @@
 
   /// Tests whether the target supports comdat
   bool supportsCOMDAT() const {
-return !isOSBinFormatMachO();
+return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());
   }
 
   /// Tests whether the target uses emulated TLS as default.
Index: clang/test/CodeGen/xcoff-comdat.cpp
===
--- /dev/null
+++ clang/test/CodeGen/xcoff-comdat.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -o - %s | FileCheck %s
+
+class a {
+  virtual void d() {}
+  virtual void e();
+};
+void a::e() {}
+
+// CHECK-NOT: = comdat
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74631: [clang][XCOFF] Indicate that XCOFF does not support COMDATs

2020-02-14 Thread David Tenty via Phabricator via cfe-commits
daltenty created this revision.
daltenty added reviewers: stevewan, sfertile, Xiangling_L.
Herald added subscribers: llvm-commits, cfe-commits, dexonsmith.
Herald added projects: clang, LLVM.
daltenty updated this revision to Diff 244708.
daltenty added a comment.

- Add missing newline


XCOFF doesn't support COMDATs, so clang shouldn't emit them.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74631

Files:
  clang/test/CodeGen/xcoff-comdat.cpp
  llvm/include/llvm/ADT/Triple.h


Index: llvm/include/llvm/ADT/Triple.h
===
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -743,7 +743,7 @@
 
   /// Tests whether the target supports comdat
   bool supportsCOMDAT() const {
-return !isOSBinFormatMachO();
+return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());
   }
 
   /// Tests whether the target uses emulated TLS as default.
Index: clang/test/CodeGen/xcoff-comdat.cpp
===
--- /dev/null
+++ clang/test/CodeGen/xcoff-comdat.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -o - %s | FileCheck %s
+
+class a {
+  virtual void d() {}
+  virtual void e();
+};
+void a::e() {}
+
+// CHECK-NOT: = comdat


Index: llvm/include/llvm/ADT/Triple.h
===
--- llvm/include/llvm/ADT/Triple.h
+++ llvm/include/llvm/ADT/Triple.h
@@ -743,7 +743,7 @@
 
   /// Tests whether the target supports comdat
   bool supportsCOMDAT() const {
-return !isOSBinFormatMachO();
+return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());
   }
 
   /// Tests whether the target uses emulated TLS as default.
Index: clang/test/CodeGen/xcoff-comdat.cpp
===
--- /dev/null
+++ clang/test/CodeGen/xcoff-comdat.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix -emit-llvm -o - %s | FileCheck %s
+
+class a {
+  virtual void d() {}
+  virtual void e();
+};
+void a::e() {}
+
+// CHECK-NOT: = comdat
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits