clang 19.0.0git
Public Member Functions | Static Public Member Functions | List of all members
clang::DarwinSDKInfo::RelatedTargetVersionMapping Class Reference

Represents a version mapping that maps from a version of one target to a version of a related target. More...

#include "clang/Basic/DarwinSDKInfo.h"

Public Member Functions

 RelatedTargetVersionMapping (VersionTuple MinimumKeyVersion, VersionTuple MaximumKeyVersion, VersionTuple MinimumValue, VersionTuple MaximumValue, llvm::DenseMap< VersionTuple, VersionTuple > Mapping)
 
const VersionTuple & getMinimumValue () const
 Returns the value with the lowest version in the mapping.
 
std::optional< VersionTuple > map (const VersionTuple &Key, const VersionTuple &MinimumValue, std::optional< VersionTuple > MaximumValue) const
 Returns the mapped key, or the appropriate Minimum / MaximumValue if they key is outside of the mapping bounds.
 
std::optional< VersionTuple > mapIntroducedAvailabilityVersion (const VersionTuple &Key) const
 Remap the 'introduced' availability version.
 
std::optional< VersionTuple > mapDeprecatedObsoletedAvailabilityVersion (const VersionTuple &Key) const
 Remap the 'deprecated' and 'obsoleted' availability version.
 

Static Public Member Functions

static std::optional< RelatedTargetVersionMappingparseJSON (const llvm::json::Object &Obj, VersionTuple MaximumDeploymentTarget)
 

Detailed Description

Represents a version mapping that maps from a version of one target to a version of a related target.

e.g. "macOS_iOSMac":{"10.15":"13.1"} is an example of a macOS -> Mac Catalyst version map.

Definition at line 86 of file DarwinSDKInfo.h.

Constructor & Destructor Documentation

◆ RelatedTargetVersionMapping()

clang::DarwinSDKInfo::RelatedTargetVersionMapping::RelatedTargetVersionMapping ( VersionTuple  MinimumKeyVersion,
VersionTuple  MaximumKeyVersion,
VersionTuple  MinimumValue,
VersionTuple  MaximumValue,
llvm::DenseMap< VersionTuple, VersionTuple >  Mapping 
)
inline

Definition at line 88 of file DarwinSDKInfo.h.

Member Function Documentation

◆ getMinimumValue()

const VersionTuple & clang::DarwinSDKInfo::RelatedTargetVersionMapping::getMinimumValue ( ) const
inline

Returns the value with the lowest version in the mapping.

Definition at line 99 of file DarwinSDKInfo.h.

◆ map()

std::optional< VersionTuple > DarwinSDKInfo::RelatedTargetVersionMapping::map ( const VersionTuple &  Key,
const VersionTuple &  MinimumValue,
std::optional< VersionTuple >  MaximumValue 
) const

Returns the mapped key, or the appropriate Minimum / MaximumValue if they key is outside of the mapping bounds.

If they key isn't mapped, but within the minimum and maximum bounds, std::nullopt is returned.

Definition at line 18 of file DarwinSDKInfo.cpp.

References map().

Referenced by map(), mapDeprecatedObsoletedAvailabilityVersion(), and mapIntroducedAvailabilityVersion().

◆ mapDeprecatedObsoletedAvailabilityVersion()

std::optional< VersionTuple > clang::DarwinSDKInfo::RelatedTargetVersionMapping::mapDeprecatedObsoletedAvailabilityVersion ( const VersionTuple &  Key) const
inline

Remap the 'deprecated' and 'obsoleted' availability version.

If None is returned for 'obsoleted', the 'unavailable' availability should be used instead. If None is returned for 'deprecated', the 'deprecated' version should be dropped.

Definition at line 125 of file DarwinSDKInfo.h.

References map().

◆ mapIntroducedAvailabilityVersion()

std::optional< VersionTuple > clang::DarwinSDKInfo::RelatedTargetVersionMapping::mapIntroducedAvailabilityVersion ( const VersionTuple &  Key) const
inline

Remap the 'introduced' availability version.

If None is returned, the 'unavailable' availability should be used instead.

Definition at line 112 of file DarwinSDKInfo.h.

References map().

◆ parseJSON()

std::optional< DarwinSDKInfo::RelatedTargetVersionMapping > DarwinSDKInfo::RelatedTargetVersionMapping::parseJSON ( const llvm::json::Object &  Obj,
VersionTuple  MaximumDeploymentTarget 
)
static

Definition at line 38 of file DarwinSDKInfo.cpp.

References clang::Max, and clang::Min.

Referenced by clang::DarwinSDKInfo::parseDarwinSDKSettingsJSON().


The documentation for this class was generated from the following files: