LLVM  14.0.0git
Classes | Public Types | Public Member Functions | List of all members
llvm::MachO::InterfaceFile Class Reference

Defines the interface file. More...

#include "llvm/TextAPI/InterfaceFile.h"

Classes

struct  const_symbol_iterator
 

Public Types

using const_target_iterator = TargetList::const_iterator
 
using const_target_range = llvm::iterator_range< const_target_iterator >
 
using const_filtered_target_iterator = llvm::filter_iterator< const_target_iterator, std::function< bool(const Target &)> >
 
using const_filtered_target_range = llvm::iterator_range< const_filtered_target_iterator >
 
using SymbolMapType = DenseMap< SymbolsMapKey, Symbol * >
 
using const_symbol_range = iterator_range< const_symbol_iterator >
 
using const_filtered_symbol_iterator = filter_iterator< const_symbol_iterator, std::function< bool(const Symbol *)> >
 
using const_filtered_symbol_range = iterator_range< const_filtered_symbol_iterator >
 

Public Member Functions

void setPath (StringRef Path_)
 Set the path from which this file was generated (if applicable). More...
 
StringRef getPath () const
 Get the path from which this file was generated (if applicable). More...
 
void setFileType (FileType Kind)
 Set the file type. More...
 
FileType getFileType () const
 Get the file type. More...
 
ArchitectureSet getArchitectures () const
 Get the architectures. More...
 
PlatformSet getPlatforms () const
 Get the platforms. More...
 
void addTarget (const Target &Target)
 Set and add target. More...
 
template<typename RangeT >
void addTargets (RangeT &&Targets)
 Set and add targets. More...
 
const_target_range targets () const
 
const_filtered_target_range targets (ArchitectureSet Archs) const
 
void setInstallName (StringRef InstallName_)
 Set the install name of the library. More...
 
StringRef getInstallName () const
 Get the install name of the library. More...
 
void setCurrentVersion (PackedVersion Version)
 Set the current version of the library. More...
 
PackedVersion getCurrentVersion () const
 Get the current version of the library. More...
 
void setCompatibilityVersion (PackedVersion Version)
 Set the compatibility version of the library. More...
 
PackedVersion getCompatibilityVersion () const
 Get the compatibility version of the library. More...
 
void setSwiftABIVersion (uint8_t Version)
 Set the Swift ABI version of the library. More...
 
uint8_t getSwiftABIVersion () const
 Get the Swift ABI version of the library. More...
 
void setTwoLevelNamespace (bool V=true)
 Specify if the library uses two-level namespace (or flat namespace). More...
 
bool isTwoLevelNamespace () const
 Check if the library uses two-level namespace. More...
 
void setApplicationExtensionSafe (bool V=true)
 Specify if the library is application extension safe (or not). More...
 
bool isApplicationExtensionSafe () const
 Check if the library is application extension safe. More...
 
void setObjCConstraint (ObjCConstraintType Constraint)
 Set the Objective-C constraint. More...
 
ObjCConstraintType getObjCConstraint () const
 Get the Objective-C constraint. More...
 
void setInstallAPI (bool V=true)
 Specify if this file was generated during InstallAPI (or not). More...
 
bool isInstallAPI () const
 Check if this file was generated during InstallAPI. More...
 
void addParentUmbrella (const Target &Target_, StringRef Parent)
 Set the parent umbrella frameworks. More...
 
const std::vector< std::pair< Target, std::string > > & umbrellas () const
 Get the list of Parent Umbrella frameworks. More...
 
void addAllowableClient (StringRef InstallName, const Target &Target)
 Add an allowable client. More...
 
const std::vector< InterfaceFileRef > & allowableClients () const
 Get the list of allowable clients. More...
 
void addReexportedLibrary (StringRef InstallName, const Target &Target)
 Add a re-exported library. More...
 
const std::vector< InterfaceFileRef > & reexportedLibraries () const
 Get the list of re-exported libraries. More...
 
void addUUID (const Target &Target, StringRef UUID)
 Add an Target/UUID pair. More...
 
void addUUID (const Target &Target, uint8_t UUID[16])
 Add an Target/UUID pair. More...
 
const std::vector< std::pair< Target, std::string > > & uuids () const
 Get the list of Target/UUID pairs. More...
 
void addDocument (std::shared_ptr< InterfaceFile > &&Document)
 Add a library for inlining to top level library. More...
 
InterfaceFilegetParent () const
 Returns the pointer to parent document if exists or nullptr otherwise. More...
 
const std::vector< std::shared_ptr< InterfaceFile > > & documents () const
 Get the list of inlined libraries. More...
 
void addSymbol (SymbolKind Kind, StringRef Name, const TargetList &Targets, SymbolFlags Flags=SymbolFlags::None)
 Add a symbol to the symbols list or extend an existing one. More...
 
const_symbol_range symbols () const
 
const_filtered_symbol_range exports () const
 
const_filtered_symbol_range undefineds () const
 
bool operator== (const InterfaceFile &O) const
 The equality is determined by attributes that impact linking compatibilities. More...
 
bool operator!= (const InterfaceFile &O) const
 

Detailed Description

Defines the interface file.

Definition at line 156 of file InterfaceFile.h.

Member Typedef Documentation

◆ const_filtered_symbol_iterator

Definition at line 376 of file InterfaceFile.h.

◆ const_filtered_symbol_range

Definition at line 378 of file InterfaceFile.h.

◆ const_filtered_target_iterator

Definition at line 214 of file InterfaceFile.h.

◆ const_filtered_target_range

Definition at line 216 of file InterfaceFile.h.

◆ const_symbol_range

Definition at line 372 of file InterfaceFile.h.

◆ const_target_iterator

Definition at line 208 of file InterfaceFile.h.

◆ const_target_range

Definition at line 209 of file InterfaceFile.h.

◆ SymbolMapType

Definition at line 356 of file InterfaceFile.h.

Member Function Documentation

◆ addAllowableClient()

void InterfaceFile::addAllowableClient ( StringRef  InstallName,
const Target Target 
)

Add an allowable client.

Mach-O Dynamic libraries have the concept of allowable clients that are checked during static link time. The name of the application or library that is being generated needs to match one of the allowable clients or the linker refuses to link this library.

Parameters
InstallNameThe name of the client that is allowed to link this library.
TargetThe target triple for which this applies.

Definition at line 49 of file InterfaceFile.cpp.

◆ addDocument()

void InterfaceFile::addDocument ( std::shared_ptr< InterfaceFile > &&  Document)

Add a library for inlining to top level library.

Parameters
DocumentThe library to inline with top level library.

Definition at line 121 of file InterfaceFile.cpp.

References llvm::lower_bound().

◆ addParentUmbrella()

void InterfaceFile::addParentUmbrella ( const Target Target_,
StringRef  Parent 
)

Set the parent umbrella frameworks.

Parameters
Target_The target applicable to Parent
ParentThe name of Parent

Definition at line 61 of file InterfaceFile.cpp.

References llvm::lower_bound().

◆ addReexportedLibrary()

void InterfaceFile::addReexportedLibrary ( StringRef  InstallName,
const Target Target 
)

Add a re-exported library.

Parameters
InstallNameThe name of the library to re-export.
TargetThe target triple for which this applies.

Definition at line 55 of file InterfaceFile.cpp.

◆ addSymbol()

void InterfaceFile::addSymbol ( SymbolKind  Kind,
StringRef  Name,
const TargetList Targets,
SymbolFlags  Flags = SymbolFlags::None 
)

Add a symbol to the symbols list or extend an existing one.

Definition at line 110 of file InterfaceFile.cpp.

References result, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().

◆ addTarget()

void InterfaceFile::addTarget ( const Target Target)

Set and add target.

Parameters
Targetthe target to add into.

Definition at line 98 of file InterfaceFile.cpp.

Referenced by addTargets().

◆ addTargets()

template<typename RangeT >
void llvm::MachO::InterfaceFile::addTargets ( RangeT &&  Targets)
inline

Set and add targets.

Add the subset of llvm::triples that is supported by Tapi

Parameters
Targetsthe collection of targets.

Definition at line 203 of file InterfaceFile.h.

References addTarget().

◆ addUUID() [1/2]

void InterfaceFile::addUUID ( const Target Target,
StringRef  UUID 
)

Add an Target/UUID pair.

Parameters
TargetThe target triple for which this applies.
UUIDThe UUID of the library for the specified architecture.

Definition at line 74 of file InterfaceFile.cpp.

References llvm::lower_bound().

Referenced by addUUID().

◆ addUUID() [2/2]

void InterfaceFile::addUUID ( const Target Target,
uint8_t  UUID[16] 
)

Add an Target/UUID pair.

Parameters
TargetThe target triple for which this applies.
UUIDThe UUID of the library for the specified architecture.

Definition at line 87 of file InterfaceFile.cpp.

References addUUID(), and i.

◆ allowableClients()

const std::vector<InterfaceFileRef>& llvm::MachO::InterfaceFile::allowableClients ( ) const
inline

Get the list of allowable clients.

Returns
Returns a list of allowable clients.

Definition at line 301 of file InterfaceFile.h.

◆ documents()

const std::vector<std::shared_ptr<InterfaceFile> >& llvm::MachO::InterfaceFile::documents ( ) const
inline

Get the list of inlined libraries.

Returns
Returns a list of the inlined frameworks.

Definition at line 348 of file InterfaceFile.h.

◆ exports()

const_filtered_symbol_range llvm::MachO::InterfaceFile::exports ( ) const
inline

◆ getArchitectures()

ArchitectureSet llvm::MachO::InterfaceFile::getArchitectures ( ) const
inline

Get the architectures.

Returns
The applicable architectures.

Definition at line 184 of file InterfaceFile.h.

References llvm::MachO::mapToArchitectureSet().

◆ getCompatibilityVersion()

PackedVersion llvm::MachO::InterfaceFile::getCompatibilityVersion ( ) const
inline

Get the compatibility version of the library.

Definition at line 239 of file InterfaceFile.h.

◆ getCurrentVersion()

PackedVersion llvm::MachO::InterfaceFile::getCurrentVersion ( ) const
inline

Get the current version of the library.

Definition at line 231 of file InterfaceFile.h.

◆ getFileType()

FileType llvm::MachO::InterfaceFile::getFileType ( ) const
inline

Get the file type.

Returns
The file type.

Definition at line 179 of file InterfaceFile.h.

◆ getInstallName()

StringRef llvm::MachO::InterfaceFile::getInstallName ( ) const
inline

Get the install name of the library.

Definition at line 225 of file InterfaceFile.h.

◆ getObjCConstraint()

ObjCConstraintType llvm::MachO::InterfaceFile::getObjCConstraint ( ) const
inline

Get the Objective-C constraint.

Definition at line 265 of file InterfaceFile.h.

◆ getParent()

InterfaceFile* llvm::MachO::InterfaceFile::getParent ( ) const
inline

Returns the pointer to parent document if exists or nullptr otherwise.

Definition at line 343 of file InterfaceFile.h.

◆ getPath()

StringRef llvm::MachO::InterfaceFile::getPath ( ) const
inline

Get the path from which this file was generated (if applicable).

Returns
The path to the source file or empty.

Definition at line 166 of file InterfaceFile.h.

◆ getPlatforms()

PlatformSet llvm::MachO::InterfaceFile::getPlatforms ( ) const
inline

Get the platforms.

Returns
The applicable platforms.

Definition at line 191 of file InterfaceFile.h.

References llvm::MachO::mapToPlatformSet().

Referenced by llvm::object::TapiFile::TapiFile().

◆ getSwiftABIVersion()

uint8_t llvm::MachO::InterfaceFile::getSwiftABIVersion ( ) const
inline

Get the Swift ABI version of the library.

Definition at line 245 of file InterfaceFile.h.

◆ isApplicationExtensionSafe()

bool llvm::MachO::InterfaceFile::isApplicationExtensionSafe ( ) const
inline

Check if the library is application extension safe.

Definition at line 257 of file InterfaceFile.h.

◆ isInstallAPI()

bool llvm::MachO::InterfaceFile::isInstallAPI ( ) const
inline

Check if this file was generated during InstallAPI.

Definition at line 271 of file InterfaceFile.h.

◆ isTwoLevelNamespace()

bool llvm::MachO::InterfaceFile::isTwoLevelNamespace ( ) const
inline

Check if the library uses two-level namespace.

Definition at line 251 of file InterfaceFile.h.

◆ operator!=()

bool llvm::MachO::InterfaceFile::operator!= ( const InterfaceFile O) const
inline

Definition at line 408 of file InterfaceFile.h.

References llvm::RISCVFenceField::O.

◆ operator==()

bool InterfaceFile::operator== ( const InterfaceFile O) const

The equality is determined by attributes that impact linking compatibilities.

UUIDs, Path, & FileKind are irrelevant since these by itself should not impact linking. This is an expensive operation.

Definition at line 131 of file InterfaceFile.cpp.

References llvm::lltok::equal, and llvm::RISCVFenceField::O.

◆ reexportedLibraries()

const std::vector<InterfaceFileRef>& llvm::MachO::InterfaceFile::reexportedLibraries ( ) const
inline

Get the list of re-exported libraries.

Returns
Returns a list of re-exported libraries.

Definition at line 314 of file InterfaceFile.h.

◆ setApplicationExtensionSafe()

void llvm::MachO::InterfaceFile::setApplicationExtensionSafe ( bool  V = true)
inline

Specify if the library is application extension safe (or not).

Definition at line 254 of file InterfaceFile.h.

◆ setCompatibilityVersion()

void llvm::MachO::InterfaceFile::setCompatibilityVersion ( PackedVersion  Version)
inline

Set the compatibility version of the library.

Definition at line 234 of file InterfaceFile.h.

References Version.

◆ setCurrentVersion()

void llvm::MachO::InterfaceFile::setCurrentVersion ( PackedVersion  Version)
inline

Set the current version of the library.

Definition at line 228 of file InterfaceFile.h.

References Version.

◆ setFileType()

void llvm::MachO::InterfaceFile::setFileType ( FileType  Kind)
inline

Set the file type.

This is used by the YAML writer to identify the specification it should use for writing the file.

Parameters
KindThe file type.

Definition at line 174 of file InterfaceFile.h.

◆ setInstallAPI()

void llvm::MachO::InterfaceFile::setInstallAPI ( bool  V = true)
inline

Specify if this file was generated during InstallAPI (or not).

Definition at line 268 of file InterfaceFile.h.

◆ setInstallName()

void llvm::MachO::InterfaceFile::setInstallName ( StringRef  InstallName_)
inline

Set the install name of the library.

Definition at line 220 of file InterfaceFile.h.

◆ setObjCConstraint()

void llvm::MachO::InterfaceFile::setObjCConstraint ( ObjCConstraintType  Constraint)
inline

Set the Objective-C constraint.

Definition at line 260 of file InterfaceFile.h.

◆ setPath()

void llvm::MachO::InterfaceFile::setPath ( StringRef  Path_)
inline

Set the path from which this file was generated (if applicable).

Parameters
Path_The path to the source file.

Definition at line 161 of file InterfaceFile.h.

◆ setSwiftABIVersion()

void llvm::MachO::InterfaceFile::setSwiftABIVersion ( uint8_t  Version)
inline

Set the Swift ABI version of the library.

Definition at line 242 of file InterfaceFile.h.

References Version.

◆ setTwoLevelNamespace()

void llvm::MachO::InterfaceFile::setTwoLevelNamespace ( bool  V = true)
inline

Specify if the library uses two-level namespace (or flat namespace).

Definition at line 248 of file InterfaceFile.h.

◆ symbols()

const_symbol_range llvm::MachO::InterfaceFile::symbols ( ) const
inline

◆ targets() [1/2]

const_target_range llvm::MachO::InterfaceFile::targets ( ) const
inline

Definition at line 210 of file InterfaceFile.h.

◆ targets() [2/2]

InterfaceFile::const_filtered_target_range InterfaceFile::targets ( ArchitectureSet  Archs) const

◆ umbrellas()

const std::vector<std::pair<Target, std::string> >& llvm::MachO::InterfaceFile::umbrellas ( ) const
inline

Get the list of Parent Umbrella frameworks.

Returns
Returns a list of target information and install name of parent umbrellas.

Definition at line 282 of file InterfaceFile.h.

◆ undefineds()

const_filtered_symbol_range llvm::MachO::InterfaceFile::undefineds ( ) const
inline

◆ uuids()

const std::vector<std::pair<Target, std::string> >& llvm::MachO::InterfaceFile::uuids ( ) const
inline

Get the list of Target/UUID pairs.

Returns
Returns a list of Target/UUID pairs.

Definition at line 333 of file InterfaceFile.h.


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