LLDB mainline
|
An abstraction for Xcode-style SDKs that works like ArchSpec. More...
#include <XcodeSDK.h>
Classes | |
struct | Info |
A parsed SDK directory name. More... | |
Public Types | |
enum | Type : int { MacOSX = 0 , iPhoneSimulator , iPhoneOS , AppleTVSimulator , AppleTVOS , WatchSimulator , watchOS , bridgeOS , Linux , unknown = -1 } |
Different types of Xcode SDKs. More... | |
Public Member Functions | |
XcodeSDK ()=default | |
Default constructor, constructs an empty string. | |
XcodeSDK (Info info) | |
Construct an XcodeSDK object from a specification. | |
XcodeSDK (std::string &&name) | |
Initialize an XcodeSDK object with an SDK name. | |
void | Merge (const XcodeSDK &other) |
The merge function follows a strict order to maintain monotonicity: | |
XcodeSDK & | operator= (const XcodeSDK &other) |
XcodeSDK (const XcodeSDK &)=default | |
bool | operator== (const XcodeSDK &other) |
Info | Parse () const |
Return parsed SDK type and version number. | |
bool | IsAppleInternalSDK () const |
llvm::VersionTuple | GetVersion () const |
Type | GetType () const |
llvm::StringRef | GetString () const |
bool | SupportsSwift () const |
Whether this Xcode SDK supports Swift. | |
Static Public Member Functions | |
static XcodeSDK | GetAnyMacOS () |
static bool | SDKSupportsModules (Type type, llvm::VersionTuple version) |
Whether LLDB feels confident importing Clang modules from this SDK. | |
static bool | SDKSupportsModules (Type desired_type, const FileSpec &sdk_path) |
static std::string | GetCanonicalName (Info info) |
Return the canonical SDK name, such as "macosx" for the macOS SDK. | |
static XcodeSDK::Type | GetSDKTypeForTriple (const llvm::Triple &triple) |
Return the best-matching SDK type for a specific triple. | |
static std::string | FindXcodeContentsDirectoryInPath (llvm::StringRef path) |
Static Public Attributes | |
static constexpr int | numSDKTypes = Linux + 1 |
Private Attributes | |
std::string | m_name |
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition at line 24 of file XcodeSDK.h.
enum lldb_private::XcodeSDK::Type : int |
Different types of Xcode SDKs.
Enumerator | |
---|---|
MacOSX | |
iPhoneSimulator | |
iPhoneOS | |
AppleTVSimulator | |
AppleTVOS | |
WatchSimulator | |
watchOS | |
bridgeOS | |
Linux | |
unknown |
Definition at line 29 of file XcodeSDK.h.
|
default |
Default constructor, constructs an empty string.
Referenced by GetAnyMacOS().
XcodeSDK::XcodeSDK | ( | XcodeSDK::Info | info | ) |
Construct an XcodeSDK object from a specification.
Definition at line 47 of file XcodeSDK.cpp.
References lldb_private::XcodeSDK::Info::internal, m_name, and lldb_private::XcodeSDK::Info::version.
|
inline |
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".
Definition at line 62 of file XcodeSDK.h.
|
default |
|
static |
Definition at line 286 of file XcodeSDK.cpp.
Referenced by lldb_private::HostInfoMacOSX::GetXcodeContentsDirectory(), and GetXcodeSDK().
|
inlinestatic |
Definition at line 63 of file XcodeSDK.h.
References XcodeSDK().
Referenced by lldb_private::PlatformMacOSX::GetSDKDirectory(), and lldb_private::HostInfoMacOSX::GetXcodeContentsDirectory().
|
static |
Return the canonical SDK name, such as "macosx" for the macOS SDK.
Definition at line 162 of file XcodeSDK.cpp.
References AppleTVOS, AppleTVSimulator, bridgeOS, lldb_private::XcodeSDK::Info::internal, iPhoneOS, iPhoneSimulator, Linux, MacOSX, lldb_private::XcodeSDK::Info::type, unknown, lldb_private::XcodeSDK::Info::version, watchOS, and WatchSimulator.
Referenced by lldb_private::PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(), lldb_private::HostInfoMacOSX::FindSDKTool(), and GetXcodeSDK().
|
static |
Return the best-matching SDK type for a specific triple.
Definition at line 256 of file XcodeSDK.cpp.
References AppleTVOS, AppleTVSimulator, iPhoneOS, iPhoneSimulator, Linux, MacOSX, unknown, watchOS, and WatchSimulator.
llvm::StringRef XcodeSDK::GetString | ( | ) | const |
Definition at line 135 of file XcodeSDK.cpp.
References m_name.
Referenced by lldb_private::HostInfoMacOSX::FindSDKTool(), lldb_private::HostInfoMacOSX::GetSDKRoot(), GetXcodeSDK(), and lldb_private::SymbolFileOnDemand::ParseXcodeSDK().
XcodeSDK::Type XcodeSDK::GetType | ( | ) | const |
Definition at line 130 of file XcodeSDK.cpp.
References m_name, and ParseSDKName().
Referenced by SDKSupportsModules().
llvm::VersionTuple XcodeSDK::GetVersion | ( | ) | const |
Definition at line 124 of file XcodeSDK.cpp.
References m_name, ParseSDKName(), and ParseSDKVersion().
Referenced by SDKSupportsModules().
bool XcodeSDK::IsAppleInternalSDK | ( | ) | const |
Definition at line 117 of file XcodeSDK.cpp.
References m_name, ParseAppleInternalSDK(), ParseSDKName(), and ParseSDKVersion().
Referenced by lldb_private::PlatformDarwin::GetSDKPathFromDebugInfo().
void XcodeSDK::Merge | ( | const XcodeSDK & | other | ) |
The merge function follows a strict order to maintain monotonicity:
Definition at line 147 of file XcodeSDK.cpp.
References l, m_name, and Parse().
Referenced by lldb_private::PlatformDarwin::GetSDKPathFromDebugInfo().
bool XcodeSDK::operator== | ( | const XcodeSDK & | other | ) |
Definition at line 59 of file XcodeSDK.cpp.
References m_name.
XcodeSDK::Info XcodeSDK::Parse | ( | ) | const |
Return parsed SDK type and version number.
Definition at line 108 of file XcodeSDK.cpp.
References lldb_private::XcodeSDK::Info::internal, m_name, ParseAppleInternalSDK(), ParseSDKName(), ParseSDKVersion(), lldb_private::XcodeSDK::Info::type, and lldb_private::XcodeSDK::Info::version.
Referenced by lldb_private::HostInfoMacOSX::FindSDKTool(), GetXcodeSDK(), Merge(), and SupportsSwift().
|
static |
Definition at line 243 of file XcodeSDK.cpp.
References lldb_private::FileSpec::GetFilename(), lldb_private::ConstString::GetStringRef(), GetType(), GetVersion(), and SDKSupportsModules().
|
static |
Whether LLDB feels confident importing Clang modules from this SDK.
Definition at line 202 of file XcodeSDK.cpp.
References AppleTVOS, AppleTVSimulator, iPhoneOS, iPhoneSimulator, MacOSX, watchOS, and WatchSimulator.
Referenced by lldb_private::PlatformDarwin::DirectoryEnumerator(), lldb_private::PlatformDarwin::GetSDKDirectoryForModules(), and SDKSupportsModules().
bool XcodeSDK::SupportsSwift | ( | ) | const |
Whether this Xcode SDK supports Swift.
Definition at line 222 of file XcodeSDK.cpp.
References AppleTVOS, AppleTVSimulator, iPhoneOS, iPhoneSimulator, Linux, MacOSX, Parse(), lldb_private::XcodeSDK::Info::type, lldb_private::XcodeSDK::Info::version, watchOS, and WatchSimulator.
|
private |
Definition at line 25 of file XcodeSDK.h.
Referenced by GetString(), GetType(), GetVersion(), IsAppleInternalSDK(), Merge(), operator==(), Parse(), and XcodeSDK().
|
staticconstexpr |
Definition at line 41 of file XcodeSDK.h.
Referenced by ParseSDKName().