aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/SmallVector.cpp
diff options
context:
space:
mode:
authorJake Egan <Jake.Egan@ibm.com>2021-08-30 10:42:59 -0400
committerJake Egan <Jake.Egan@ibm.com>2021-08-30 10:59:47 -0400
commit57b46056b9435b52028fd96bed43f562be1705fd (patch)
tree675db12d3edf41fd65df5d2ce7082ea6d63bc48f /llvm/lib/Support/SmallVector.cpp
parent2e5c17d19e370c4d4f17ee89ca645113692f5407 (diff)
downloadllvm-57b46056b9435b52028fd96bed43f562be1705fd.zip
llvm-57b46056b9435b52028fd96bed43f562be1705fd.tar.gz
llvm-57b46056b9435b52028fd96bed43f562be1705fd.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Support/SmallVector.cpp')
-rw-r--r--llvm/lib/Support/SmallVector.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Support/SmallVector.cpp b/llvm/lib/Support/SmallVector.cpp
index 0e2378b..61780e7 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 *),