Update bionic after Clang rebase
After the new rebase of Clang, we now supports alloc_size attribute, so
we can remove the warning about switching to alloc_size once Clang has
support.
Compiler.setInvocation has changed argument type from raw pointer to
shared pointer. Add version check here so that we can build under either
old rebase or the new rebase.
Test: build
Bug: 37423073
Change-Id: I4563eaf93bae6c59a4a19318f8caa92bd361b3ab
diff --git a/libc/include/malloc.h b/libc/include/malloc.h
index 752ee72..412e3f0 100644
--- a/libc/include/malloc.h
+++ b/libc/include/malloc.h
@@ -23,13 +23,9 @@
__BEGIN_DECLS
-#if defined(__clang__)
-/* clang should support alloc_size in the nearish future. */
-#if __has_attribute(alloc_size)
-#error "We should enable alloc_size for clang."
-#else
+// Remove the workaround once b/37423073 is fixed.
+#if defined(__clang__) && !__has_attribute(alloc_size)
#define __BIONIC_ALLOC_SIZE(...)
-#endif
#else
#define __BIONIC_ALLOC_SIZE(...) __attribute__((__alloc_size__(__VA_ARGS__)))
#endif