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 , XRSimulator , XROS , 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. | |
XcodeSDK (std::string name, FileSpec sysroot) | |
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) const |
Info | Parse () const |
Return parsed SDK type and version number. | |
bool | IsAppleInternalSDK () const |
llvm::VersionTuple | GetVersion () const |
Type | GetType () const |
llvm::StringRef | GetString () const |
const FileSpec & | GetSysroot () const |
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 |
FileSpec | m_sysroot |
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition at line 25 of file XcodeSDK.h.
enum lldb_private::XcodeSDK::Type : int |
Different types of Xcode SDKs.
Enumerator | |
---|---|
MacOSX | |
iPhoneSimulator | |
iPhoneOS | |
AppleTVSimulator | |
AppleTVOS | |
WatchSimulator | |
watchOS | |
XRSimulator | |
XROS | |
bridgeOS | |
Linux | |
unknown |
Definition at line 31 of file XcodeSDK.h.
|
default |
Default constructor, constructs an empty string.
Referenced by GetAnyMacOS(), Merge(), operator=(), operator==(), SDKSupportsModules(), and XcodeSDK().
XcodeSDK::XcodeSDK | ( | XcodeSDK::Info | info | ) |
Construct an XcodeSDK object from a specification.
Definition at line 51 of file XcodeSDK.cpp.
|
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 66 of file XcodeSDK.h.
References m_name.
|
inline |
Definition at line 67 of file XcodeSDK.h.
|
default |
References XcodeSDK().
|
static |
Definition at line 293 of file XcodeSDK.cpp.
Referenced by lldb_private::HostInfoMacOSX::GetXcodeContentsDirectory(), and GetXcodeSDK().
|
inlinestatic |
Definition at line 71 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 177 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, WatchSimulator, XROS, and XRSimulator.
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 259 of file XcodeSDK.cpp.
References AppleTVOS, AppleTVSimulator, iPhoneOS, iPhoneSimulator, Linux, MacOSX, unknown, watchOS, WatchSimulator, XROS, and XRSimulator.
llvm::StringRef XcodeSDK::GetString | ( | ) | const |
Definition at line 143 of file XcodeSDK.cpp.
References m_name.
Referenced by lldb_private::HostInfoMacOSX::FindSDKTool(), lldb_private::HostInfoMacOSX::GetSDKRoot(), GetXcodeSDK(), and lldb_private::SymbolFileOnDemand::ParseXcodeSDK().
const FileSpec & XcodeSDK::GetSysroot | ( | ) | const |
Definition at line 145 of file XcodeSDK.cpp.
References m_sysroot.
Referenced by ResolveSDKPathFromDebugInfo().
XcodeSDK::Type XcodeSDK::GetType | ( | ) | const |
Definition at line 138 of file XcodeSDK.cpp.
References m_name, and ParseSDKName().
Referenced by SDKSupportsModules().
llvm::VersionTuple XcodeSDK::GetVersion | ( | ) | const |
Definition at line 132 of file XcodeSDK.cpp.
References m_name, ParseSDKName(), and ParseSDKVersion().
Referenced by SDKSupportsModules().
bool XcodeSDK::IsAppleInternalSDK | ( | ) | const |
Definition at line 125 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 157 of file XcodeSDK.cpp.
References l, m_name, m_sysroot, Parse(), and XcodeSDK().
Referenced by lldb_private::PlatformDarwin::GetSDKPathFromDebugInfo(), and ResolveSDKPathFromDebugInfo().
References XcodeSDK().
Definition at line 63 of file XcodeSDK.cpp.
References m_name, and XcodeSDK().
XcodeSDK::Info XcodeSDK::Parse | ( | ) | const |
Return parsed SDK type and version number.
Definition at line 116 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(), and Merge().
|
static |
Definition at line 246 of file XcodeSDK.cpp.
References lldb_private::FileSpec::GetFilename(), lldb_private::ConstString::GetStringRef(), GetType(), GetVersion(), SDKSupportsModules(), and XcodeSDK().
|
static |
Whether LLDB feels confident importing Clang modules from this SDK.
Definition at line 223 of file XcodeSDK.cpp.
References AppleTVOS, AppleTVSimulator, iPhoneOS, iPhoneSimulator, MacOSX, watchOS, WatchSimulator, XROS, and XRSimulator.
Referenced by lldb_private::PlatformDarwin::DirectoryEnumerator(), lldb_private::PlatformDarwin::GetSDKDirectoryForModules(), and SDKSupportsModules().
|
private |
Definition at line 26 of file XcodeSDK.h.
Referenced by GetString(), GetType(), GetVersion(), IsAppleInternalSDK(), Merge(), operator==(), Parse(), XcodeSDK(), XcodeSDK(), and XcodeSDK().
|
private |
Definition at line 27 of file XcodeSDK.h.
Referenced by GetSysroot(), Merge(), and XcodeSDK().
|
staticconstexpr |
Definition at line 45 of file XcodeSDK.h.
Referenced by ParseSDKName().