Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/include/lldb/Utility/XcodeSDK.h b/linux-x64/clang/include/lldb/Utility/XcodeSDK.h
new file mode 100644
index 0000000..878b131
--- /dev/null
+++ b/linux-x64/clang/include/lldb/Utility/XcodeSDK.h
@@ -0,0 +1,96 @@
+//===-- XcodeSDK.h ----------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_UTILITY_SDK_H
+#define LLDB_UTILITY_SDK_H
+
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/VersionTuple.h"
+#include <tuple>
+
+namespace llvm {
+class Triple;
+}
+
+namespace lldb_private {
+
+/// An abstraction for Xcode-style SDKs that works like \ref ArchSpec.
+class XcodeSDK {
+ std::string m_name;
+
+public:
+ /// Different types of Xcode SDKs.
+ enum Type : int {
+ MacOSX = 0,
+ iPhoneSimulator,
+ iPhoneOS,
+ AppleTVSimulator,
+ AppleTVOS,
+ WatchSimulator,
+ watchOS,
+ bridgeOS,
+ Linux,
+ unknown = -1
+ };
+ static constexpr int numSDKTypes = Linux + 1;
+
+ /// A parsed SDK directory name.
+ struct Info {
+ Type type = unknown;
+ llvm::VersionTuple version;
+ bool internal = false;
+
+ Info() = default;
+ bool operator<(const Info &other) const;
+ bool operator==(const Info &other) const;
+ };
+
+
+ /// Default constructor, constructs an empty string.
+ XcodeSDK() = default;
+ /// Construct an XcodeSDK object from a specification.
+ XcodeSDK(Info info);
+ /// Initialize an XcodeSDK object with an SDK name. The SDK name is the last
+ /// directory component of a path one would pass to clang's -isysroot
+ /// parameter. For example, "MacOSX.10.14.sdk".
+ XcodeSDK(std::string &&name) : m_name(std::move(name)) {}
+ static XcodeSDK GetAnyMacOS() { return XcodeSDK("MacOSX.sdk"); }
+
+ /// The merge function follows a strict order to maintain monotonicity:
+ /// 1. SDK with the higher SDKType wins.
+ /// 2. The newer SDK wins.
+ void Merge(const XcodeSDK &other);
+
+ XcodeSDK &operator=(const XcodeSDK &other);
+ XcodeSDK(const XcodeSDK&) = default;
+ bool operator==(const XcodeSDK &other);
+
+ /// Return parsed SDK type and version number.
+ Info Parse() const;
+ bool IsAppleInternalSDK() const;
+ llvm::VersionTuple GetVersion() const;
+ Type GetType() const;
+ llvm::StringRef GetString() const;
+ /// Whether this Xcode SDK supports Swift.
+ bool SupportsSwift() const;
+
+ /// Whether LLDB feels confident importing Clang modules from this SDK.
+ static bool SDKSupportsModules(Type type, llvm::VersionTuple version);
+ static bool SDKSupportsModules(Type desired_type, const FileSpec &sdk_path);
+ /// Return the canonical SDK name, such as "macosx" for the macOS SDK.
+ static std::string GetCanonicalName(Info info);
+ /// Return the best-matching SDK type for a specific triple.
+ static XcodeSDK::Type GetSDKTypeForTriple(const llvm::Triple &triple);
+
+ static std::string FindXcodeContentsDirectoryInPath(llvm::StringRef path);
+};
+
+} // namespace lldb_private
+
+#endif