1 //===-- HostInfoMacOSX.h ----------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_HOST_MACOSX_HOSTINFOMACOSX_H
10 #define LLDB_HOST_MACOSX_HOSTINFOMACOSX_H
11 
12 #include "lldb/Host/posix/HostInfoPosix.h"
13 #include "lldb/Utility/FileSpec.h"
14 #include "lldb/Utility/XcodeSDK.h"
15 #include "llvm/Support/VersionTuple.h"
16 
17 namespace lldb_private {
18 
19 class ArchSpec;
20 
21 class HostInfoMacOSX : public HostInfoPosix {
22   friend class HostInfoBase;
23 
24 private:
25   // Static class, unconstructable.
26   HostInfoMacOSX() = delete;
27   ~HostInfoMacOSX() = delete;
28 
29 public:
30   static llvm::VersionTuple GetOSVersion();
31   static llvm::VersionTuple GetMacCatalystVersion();
32   static bool GetOSBuildString(std::string &s);
33   static bool GetOSKernelDescription(std::string &s);
34   static FileSpec GetProgramFileSpec();
35   static FileSpec GetXcodeContentsDirectory();
36   static FileSpec GetXcodeDeveloperDirectory();
37 
38   /// Query xcrun to find an Xcode SDK directory.
39   static llvm::StringRef GetXcodeSDKPath(XcodeSDK sdk);
40 
41   /// Shared cache utilities
42   static SharedCacheImageInfo
43   GetSharedCacheImageInfo(llvm::StringRef image_name);
44 
45 protected:
46   static bool ComputeSupportExeDirectory(FileSpec &file_spec);
47   static void ComputeHostArchitectureSupport(ArchSpec &arch_32,
48                                              ArchSpec &arch_64);
49   static bool ComputeHeaderDirectory(FileSpec &file_spec);
50   static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
51   static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
52 };
53 }
54 
55 #endif
56