versioner: Port to clang-r339409b

This commit ports versions to clang-r339409b and utilizes
`libclang-cxx.so`.

Bug: 113263746
Test: ./bionic/tools/versioner/run_tests.py
Change-Id: Ib104a6c8c2c69df51cfa2760dbca125f4cfa054b
diff --git a/tools/versioner/README.md b/tools/versioner/README.md
index 39b5128..edb32be 100644
--- a/tools/versioner/README.md
+++ b/tools/versioner/README.md
@@ -2,7 +2,7 @@
 Use clang to verify the correctness of bionic's availability attributes against the NDK platform definitions.
 
 #### Build
-Build with `FORCE_BUILD_LLVM_COMPONENTS=true mma -j48`
+Build with `LLVM_BUILD_HOST_TOOLS=true mma -j48`
 
 #### Use
 `versioner -p platforms current dependencies`
diff --git a/tools/versioner/src/Android.bp b/tools/versioner/src/Android.bp
index c3721ef..59e1b92 100644
--- a/tools/versioner/src/Android.bp
+++ b/tools/versioner/src/Android.bp
@@ -1,6 +1,8 @@
 cc_binary_host {
     name: "versioner",
 
+    defaults: ["llvm-build-host-tools-defaults"],
+
     cpp_std: "gnu++17",
 
     // b/117120485 bugprone-exception-escape hangs with DeclarationDatabase.cpp
@@ -20,16 +22,11 @@
     ],
 
     shared_libs: [
-        "libclang_android",
-        "libLLVM_android",
+        "libclang_cxx_host",
+        "libLLVM_host",
         "libbase",
     ],
 
-    header_libs: [
-        "llvm-headers",
-        "clang-headers",
-    ],
-
     cflags: [
         "-Wall",
         "-Wextra",
diff --git a/tools/versioner/src/Driver.cpp b/tools/versioner/src/Driver.cpp
index 8911190..7c4aa23 100644
--- a/tools/versioner/src/Driver.cpp
+++ b/tools/versioner/src/Driver.cpp
@@ -42,7 +42,6 @@
 #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"
@@ -256,13 +255,7 @@
 
   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);