[llvm] 57b4605 - [AIX] Suppress -Waix-compat warning with SmallVector class

Jake Egan via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 30 08:00:00 PDT 2021


Author: Jake Egan
Date: 2021-08-30T10:59:47-04:00
New Revision: 57b46056b9435b52028fd96bed43f562be1705fd

URL: https://github.com/llvm/llvm-project/commit/57b46056b9435b52028fd96bed43f562be1705fd
DIFF: https://github.com/llvm/llvm-project/commit/57b46056b9435b52028fd96bed43f562be1705fd.diff

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

When building LLVM with Open XL and -Werror is specified, the -Waix-compat warning becomes an error. This patch updates the SmallVector class to suppress the -Waix-compat warning/error on AIX.

Reviewed By: daltenty

Differential Revision: https://reviews.llvm.org/D108577

Added: 
    

Modified: 
    llvm/lib/Support/SmallVector.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/SmallVector.cpp b/llvm/lib/Support/SmallVector.cpp
index 0e2378b24c38d..61780e73e408a 100644
--- a/llvm/lib/Support/SmallVector.cpp
+++ b/llvm/lib/Support/SmallVector.cpp
@@ -19,12 +19,21 @@ using namespace llvm;
 
 // 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 *),


        


More information about the llvm-commits mailing list