[PATCH] D108577: [AIX] Suppress -Waix-compat warning with SmallVector class

Jake Egan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 27 09:07:50 PDT 2021


Jake-Egan updated this revision to Diff 369119.
Jake-Egan added a comment.

Added a comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108577

Files:
  llvm/lib/Support/SmallVector.cpp


Index: llvm/lib/Support/SmallVector.cpp
===================================================================
--- llvm/lib/Support/SmallVector.cpp
+++ llvm/lib/Support/SmallVector.cpp
@@ -19,12 +19,21 @@
 
 // Check that no bytes are wasted and everything is well-aligned.
 namespace {
+// These structures may cause binary compat warnings on AIX. Suppress the
+// warning since we are only using these types for the static assertions below.
+#if defined(_AIX)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Waix-compat"
+#endif
 struct Struct16B {
   alignas(16) void *X;
 };
 struct Struct32B {
   alignas(32) void *X;
 };
+#if defined(_AIX)
+#pragma GCC diagnostic pop
+#endif
 }
 static_assert(sizeof(SmallVector<void *, 0>) ==
                   sizeof(unsigned) * 2 + sizeof(void *),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108577.369119.patch
Type: text/x-patch
Size: 804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210827/927a3f29/attachment.bin>


More information about the llvm-commits mailing list