Merge "Update bionic after Clang rebase"
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
diff --git a/tools/versioner/src/Driver.cpp b/tools/versioner/src/Driver.cpp
index 215dc3c..1b631b6 100644
--- a/tools/versioner/src/Driver.cpp
+++ b/tools/versioner/src/Driver.cpp
@@ -42,6 +42,7 @@
 #include <llvm/ADT/IntrusiveRefCntPtr.h>
 #include <llvm/ADT/SmallVector.h>
 #include <llvm/ADT/StringRef.h>
+#include <llvm/Config/config.h>
 
 #include "Arch.h"
 #include "DeclarationDatabase.h"
@@ -237,7 +238,14 @@
   }
 
   clang::CompilerInstance Compiler;
+
+// Remove the workaround once b/35936936 is fixed.
+#if LLVM_VERSION_MAJOR >= 5
+  Compiler.setInvocation(std::move(invocation));
+#else
   Compiler.setInvocation(invocation.release());
+#endif
+
   Compiler.setDiagnostics(diags.get());
   Compiler.setVirtualFileSystem(vfs);