LLVM: llvm::MachO::InterfaceFile Class Reference (original) (raw)
Defines the interface file. More...
#include "[llvm/TextAPI/InterfaceFile.h](InterfaceFile%5F8h%5Fsource.html)"
| Public Member Functions | |
|---|---|
| InterfaceFile (std::unique_ptr< SymbolSet > &&InputSymbols) | |
| InterfaceFile () | |
| void | setPath (StringRef Path_) |
| Set the path from which this file was generated (if applicable). | |
| StringRef | getPath () const |
| Get the path from which this file was generated (if applicable). | |
| void | setFileType (FileType Kind) |
| Set the file type. | |
| FileType | getFileType () const |
| Get the file type. | |
| ArchitectureSet | getArchitectures () const |
| Get the architectures. | |
| PlatformSet | getPlatforms () const |
| Get the platforms. | |
| LLVM_ABI void | addTarget (const Target &Target) |
| Set and add target. | |
| bool | hasTarget (const Target &Targ) const |
| Determine if target triple slice exists in file. | |
| template | |
| void | addTargets (RangeT &&Targets) |
| Set and add targets. | |
| const_target_range | targets () const |
| LLVM_ABI const_filtered_target_range | targets (ArchitectureSet Archs) const |
| void | setInstallName (StringRef InstallName_) |
| Set the install name of the library. | |
| StringRef | getInstallName () const |
| Get the install name of the library. | |
| void | setCurrentVersion (PackedVersion Version) |
| Set the current version of the library. | |
| PackedVersion | getCurrentVersion () const |
| Get the current version of the library. | |
| void | setCompatibilityVersion (PackedVersion Version) |
| Set the compatibility version of the library. | |
| PackedVersion | getCompatibilityVersion () const |
| Get the compatibility version of the library. | |
| void | setSwiftABIVersion (uint8_t Version) |
| Set the Swift ABI version of the library. | |
| uint8_t | getSwiftABIVersion () const |
| Get the Swift ABI version of the library. | |
| void | setTwoLevelNamespace (bool V=true) |
| Specify if the library uses two-level namespace (or flat namespace). | |
| bool | isTwoLevelNamespace () const |
| Check if the library uses two-level namespace. | |
| void | setOSLibNotForSharedCache (bool V=true) |
| Specify if the library is an OS library but not shared cache eligible. | |
| bool | isOSLibNotForSharedCache () const |
| Check if the library is an OS library that is not shared cache eligible. | |
| void | setApplicationExtensionSafe (bool V=true) |
| Specify if the library is application extension safe (or not). | |
| bool | isApplicationExtensionSafe () const |
| Check if the library is application extension safe. | |
| bool | hasSimulatorSupport () const |
| Check if the library has simulator support. | |
| void | setSimulatorSupport (bool V=true) |
| Specify if the library has simulator support. | |
| void | setObjCConstraint (ObjCConstraintType Constraint) |
| Set the Objective-C constraint. | |
| ObjCConstraintType | getObjCConstraint () const |
| Get the Objective-C constraint. | |
| LLVM_ABI void | addParentUmbrella (const Target &Target_, StringRef Parent) |
| Set the parent umbrella frameworks. | |
| const std::vector< std::pair< Target, std::string > > & | umbrellas () const |
| Get the list of Parent Umbrella frameworks. | |
| LLVM_ABI void | addAllowableClient (StringRef InstallName, const Target &Target) |
| Add an allowable client. | |
| const std::vector< InterfaceFileRef > & | allowableClients () const |
| Get the list of allowable clients. | |
| LLVM_ABI void | addReexportedLibrary (StringRef InstallName, const Target &Target) |
| Add a re-exported library. | |
| const std::vector< InterfaceFileRef > & | reexportedLibraries () const |
| Get the list of re-exported libraries. | |
| LLVM_ABI void | addDocument (std::shared_ptr< InterfaceFile > &&Document) |
| Add a library for inlining to top level library. | |
| InterfaceFile * | getParent () const |
| Returns the pointer to parent document if exists or nullptr otherwise. | |
| const std::vector< std::shared_ptr< InterfaceFile > > & | documents () const |
| Get the list of inlined libraries. | |
| LLVM_ABI void | addRPath (StringRef RPath, const Target &InputTarget) |
| Set the runpath search paths. | |
| const std::vector< std::pair< Target, std::string > > & | rpaths () const |
| Get the list of runpath search paths. | |
| std::optional< const Symbol * > | getSymbol (EncodeKind Kind, StringRef Name, ObjCIFSymbolKind ObjCIF=ObjCIFSymbolKind::None) const |
| Get symbol if exists in file. | |
| template<typename RangeT, typename ElT = std::remove_reference_t< decltype(*std::begin(std::declval()))>> | |
| void | addSymbol (EncodeKind Kind, StringRef Name, RangeT &&Targets, SymbolFlags Flags=SymbolFlags::None) |
| Add a symbol to the symbols list or extend an existing one. | |
| void | addSymbol (EncodeKind Kind, StringRef Name, TargetList &&Targets, SymbolFlags Flags=SymbolFlags::None) |
| Add Symbol with multiple targets. | |
| void | addSymbol (EncodeKind Kind, StringRef Name, Target &Target, SymbolFlags Flags=SymbolFlags::None) |
| Add Symbol with single target. | |
| size_t | symbolsCount () const |
| Get size of symbol set. | |
| const_symbol_range | symbols () const |
| const_filtered_symbol_range | exports () const |
| const_filtered_symbol_range | reexports () const |
| const_filtered_symbol_range | undefineds () const |
| LLVM_ABI llvm::Expected< std::unique_ptr< InterfaceFile > > | extract (Architecture Arch) const |
| Extract architecture slice from Interface. | |
| LLVM_ABI llvm::Expected< std::unique_ptr< InterfaceFile > > | remove (Architecture Arch) const |
| Remove architecture slice from Interface. | |
| LLVM_ABI llvm::Expected< std::unique_ptr< InterfaceFile > > | merge (const InterfaceFile *O) const |
| Merge Interfaces for the same library. | |
| LLVM_ABI void | inlineLibrary (std::shared_ptr< InterfaceFile > Library, bool Overwrite=false) |
| Inline reexported library into Interface. | |
| LLVM_ABI void | setFromBinaryAttrs (const RecordsSlice::BinaryAttrs &BA, const Target &Targ) |
| Set InterfaceFile properties from pre-gathered binary attributes, if they are not set already. | |
| LLVM_ABI bool | operator== (const InterfaceFile &O) const |
| The equality is determined by attributes that impact linking compatibilities. | |
| bool | operator!= (const InterfaceFile &O) const |
Defines the interface file.
Definition at line 106 of file InterfaceFile.h.
◆ const_filtered_symbol_range
◆ const_filtered_target_iterator
Initial value:
TargetList::const_iterator const_target_iterator
filter_iterator_impl< WrappedIteratorT, PredicateT, detail::fwd_or_bidi_tag< WrappedIteratorT > > filter_iterator
Defines filter_iterator to a suitable specialization of filter_iterator_impl, based on the underlying...
Definition at line 173 of file InterfaceFile.h.
◆ const_filtered_target_range
Initial value:
A range adaptor for a pair of iterators.
Definition at line 176 of file InterfaceFile.h.
◆ const_symbol_range
◆ const_target_iterator
◆ const_target_range
| llvm::MachO::InterfaceFile::InterfaceFile ( std::unique_ptr< SymbolSet > && InputSymbols) | inline |
|---|
◆ InterfaceFile() [2/2]
| llvm::MachO::InterfaceFile::InterfaceFile ( ) | inline |
|---|
◆ addAllowableClient()
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
| InstallName | The name of the client that is allowed to link this library. |
|---|---|
| Target | The target triple for which this applies. |
Definition at line 24 of file InterfaceFile.cpp.
References llvm::MachO::addEntry().
Referenced by setFromBinaryAttrs().
◆ addDocument()
| void InterfaceFile::addDocument | ( | std::shared_ptr< InterfaceFile > && | Document | ) |
|---|
◆ addParentUmbrella()
◆ addReexportedLibrary()
◆ addRPath()
Set the runpath search paths.
Parameters
| RPath | The name of runpath. |
|---|---|
| InputTarget | The target applicable to runpath search path. |
Definition at line 55 of file InterfaceFile.cpp.
References llvm::is_contained().
◆ addSymbol() [1/3]
template<typename RangeT, typename ElT = std::remove_reference_t< decltype(*std::begin(std::declval()))>>
◆ addSymbol() [2/3]
Add Symbol with single target.
Parameters
| Kind | The kind of global symbol to record. |
|---|---|
| Name | The name of the symbol. |
| Target | The target the symbol is defined in. |
| Flags | The properties the symbol holds. |
Definition at line 353 of file InterfaceFile.h.
References llvm::MachO::None.
◆ addSymbol() [3/3]
Add Symbol with multiple targets.
Parameters
| Kind | The kind of global symbol to record. |
|---|---|
| Name | The name of the symbol. |
| Targets | The list of targets the symbol is defined in. |
| Flags | The properties the symbol holds. |
Definition at line 342 of file InterfaceFile.h.
References llvm::MachO::None.
◆ addTarget()
◆ addTargets()
template
| void llvm::MachO::InterfaceFile::addTargets ( RangeT && Targets) | inline |
|---|
Set and add targets.
Add the subset of llvm::triples that is supported by Tapi
Parameters
| Targets | the collection of targets. |
|---|
Definition at line 164 of file InterfaceFile.h.
References addTarget().
◆ allowableClients()
◆ 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 299 of file InterfaceFile.h.
◆ exports()
| const_filtered_symbol_range llvm::MachO::InterfaceFile::exports ( ) const | inline |
|---|
◆ extract()
Extract architecture slice from Interface.
Parameters
| Arch | architecture to extract from. |
|---|
Returns
New InterfaceFile with extracted architecture slice.
Definition at line 300 of file InterfaceFile.cpp.
References allowableClients(), llvm::MachO::Target::Arch, llvm::MachO::getArchitectureName(), getArchitectures(), getCompatibilityVersion(), getCurrentVersion(), getFileType(), getInstallName(), getPath(), getSwiftABIVersion(), llvm::inconvertibleErrorCode(), InterfaceFile(), isApplicationExtensionSafe(), isOSLibNotForSharedCache(), isTwoLevelNamespace(), llvm::Lib, llvm::make_error(), reexportedLibraries(), rpaths(), symbols(), targets(), and umbrellas().
◆ getArchitectures()
| ArchitectureSet llvm::MachO::InterfaceFile::getArchitectures ( ) const | inline |
|---|
◆ getCompatibilityVersion()
| PackedVersion llvm::MachO::InterfaceFile::getCompatibilityVersion ( ) const | inline |
|---|
◆ getCurrentVersion()
| PackedVersion llvm::MachO::InterfaceFile::getCurrentVersion ( ) const | inline |
|---|
◆ getFileType()
| FileType llvm::MachO::InterfaceFile::getFileType ( ) const | inline |
|---|
◆ getInstallName()
| StringRef llvm::MachO::InterfaceFile::getInstallName ( ) const | inline |
|---|
◆ getObjCConstraint()
◆ getParent()
| InterfaceFile * llvm::MachO::InterfaceFile::getParent ( ) const | inline |
|---|
◆ getPath()
| StringRef llvm::MachO::InterfaceFile::getPath ( ) const | inline |
|---|
◆ getPlatforms()
| PlatformSet llvm::MachO::InterfaceFile::getPlatforms ( ) const | inline |
|---|
◆ getSwiftABIVersion()
| uint8_t llvm::MachO::InterfaceFile::getSwiftABIVersion ( ) const | inline |
|---|
◆ getSymbol()
Get symbol if exists in file.
Parameters
| Kind | The kind of global symbol to record. |
|---|---|
| Name | The name of the symbol. |
| ObjCIF | The ObjCInterface symbol type, if applicable. |
Definition at line 321 of file InterfaceFile.h.
References llvm::MachO::None.
◆ hasSimulatorSupport()
| bool llvm::MachO::InterfaceFile::hasSimulatorSupport ( ) const | inline |
|---|
◆ hasTarget()
| bool llvm::MachO::InterfaceFile::hasTarget ( const Target & Targ) const | inline |
|---|
◆ inlineLibrary()
| void InterfaceFile::inlineLibrary | ( | std::shared_ptr< InterfaceFile > | Library, |
|---|---|---|---|
| bool | Overwrite = false ) |
◆ isApplicationExtensionSafe()
| bool llvm::MachO::InterfaceFile::isApplicationExtensionSafe ( ) const | inline |
|---|
◆ isOSLibNotForSharedCache()
| bool llvm::MachO::InterfaceFile::isOSLibNotForSharedCache ( ) const | inline |
|---|
◆ isTwoLevelNamespace()
| bool llvm::MachO::InterfaceFile::isTwoLevelNamespace ( ) const | inline |
|---|
◆ merge()
Merge Interfaces for the same library.
The following library attributes must match.
- Install name, Current & Compatibility version,
- Two-level namespace enablement, and App extension enablement.
Parameters
Returns
New Interface File that was merged.
Definition at line 121 of file InterfaceFile.cpp.
References allowableClients(), getCompatibilityVersion(), getCurrentVersion(), getFileType(), getInstallName(), getPath(), getSwiftABIVersion(), llvm::inconvertibleErrorCode(), InterfaceFile(), InterfaceFile(), isApplicationExtensionSafe(), isOSLibNotForSharedCache(), isTwoLevelNamespace(), llvm::Lib, llvm::make_error(), reexportedLibraries(), rpaths(), symbols(), targets(), and umbrellas().
◆ operator!=()
◆ operator==()
◆ reexportedLibraries()
◆ reexports()
| const_filtered_symbol_range llvm::MachO::InterfaceFile::reexports ( ) const | inline |
|---|
◆ remove()
Remove architecture slice from Interface.
Parameters
| Arch | architecture to remove. |
|---|
Returns
New Interface File with removed architecture slice.
Definition at line 217 of file InterfaceFile.cpp.
References llvm::MachO::ArchitectureSet::All(), allowableClients(), llvm::MachO::Target::Arch, llvm::MachO::getArchitectureName(), getArchitectures(), getCompatibilityVersion(), getCurrentVersion(), getFileType(), getInstallName(), getPath(), getSwiftABIVersion(), llvm::inconvertibleErrorCode(), InterfaceFile(), isApplicationExtensionSafe(), isOSLibNotForSharedCache(), isTwoLevelNamespace(), llvm::Lib, llvm::make_error(), llvm::MachO::NoSuchArchitecture, reexportedLibraries(), symbols(), targets(), and umbrellas().
◆ rpaths()
| const std::vector< std::pair< Target, std::string > > & llvm::MachO::InterfaceFile::rpaths ( ) const | inline |
|---|
Get the list of runpath search paths.
Returns
Returns a list of the rpaths per target.
Definition at line 311 of file InterfaceFile.h.
Referenced by extract(), and merge().
◆ setApplicationExtensionSafe()
| void llvm::MachO::InterfaceFile::setApplicationExtensionSafe ( bool V = true) | inline |
|---|
◆ setCompatibilityVersion()
| void llvm::MachO::InterfaceFile::setCompatibilityVersion ( PackedVersion Version) | inline |
|---|
◆ setCurrentVersion()
| void llvm::MachO::InterfaceFile::setCurrentVersion ( PackedVersion Version) | inline |
|---|
◆ 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
Definition at line 128 of file InterfaceFile.h.
Referenced by setFromBinaryAttrs().
◆ setFromBinaryAttrs()
Set InterfaceFile properties from pre-gathered binary attributes, if they are not set already.
Parameters
| BA | Attributes typically represented in load commands. |
|---|---|
| Targ | MachO Target slice to add attributes to. |
Definition at line 357 of file InterfaceFile.cpp.
References addAllowableClient(), addParentUmbrella(), addReexportedLibrary(), llvm::MachO::RecordsSlice::BinaryAttrs::AllowableClients, llvm::MachO::RecordsSlice::BinaryAttrs::AppExtensionSafe, llvm::MachO::RecordsSlice::BinaryAttrs::CompatVersion, llvm::MachO::RecordsSlice::BinaryAttrs::CurrentVersion, llvm::StringRef::empty(), llvm::MachO::RecordsSlice::BinaryAttrs::File, getCompatibilityVersion(), getCurrentVersion(), getFileType(), getInstallName(), getPath(), getSwiftABIVersion(), llvm::MachO::RecordsSlice::BinaryAttrs::InstallName, isApplicationExtensionSafe(), isOSLibNotForSharedCache(), isTwoLevelNamespace(), llvm::Lib, llvm::MachO::RecordsSlice::BinaryAttrs::OSLibNotForSharedCache, llvm::MachO::RecordsSlice::BinaryAttrs::ParentUmbrella, llvm::MachO::RecordsSlice::BinaryAttrs::Path, llvm::MachO::RecordsSlice::BinaryAttrs::RexportedLibraries, setApplicationExtensionSafe(), setCompatibilityVersion(), setCurrentVersion(), setFileType(), setInstallName(), setOSLibNotForSharedCache(), setPath(), setSwiftABIVersion(), setTwoLevelNamespace(), llvm::MachO::RecordsSlice::BinaryAttrs::SwiftABI, and llvm::MachO::RecordsSlice::BinaryAttrs::TwoLevelNamespace.
◆ setInstallName()
| void llvm::MachO::InterfaceFile::setInstallName ( StringRef InstallName_) | inline |
|---|
◆ setObjCConstraint()
| void llvm::MachO::InterfaceFile::setObjCConstraint ( ObjCConstraintType Constraint) | inline |
|---|
◆ setOSLibNotForSharedCache()
| void llvm::MachO::InterfaceFile::setOSLibNotForSharedCache ( bool V = true) | inline |
|---|
◆ 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 115 of file InterfaceFile.h.
Referenced by setFromBinaryAttrs().
◆ setSimulatorSupport()
| void llvm::MachO::InterfaceFile::setSimulatorSupport ( bool V = true) | inline |
|---|
Specify if the library has simulator support.
Definition at line 232 of file InterfaceFile.h.
◆ setSwiftABIVersion()
| void llvm::MachO::InterfaceFile::setSwiftABIVersion ( uint8_t Version) | inline |
|---|
◆ setTwoLevelNamespace()
| void llvm::MachO::InterfaceFile::setTwoLevelNamespace ( bool V = true) | inline |
|---|
◆ symbols()
| const_symbol_range llvm::MachO::InterfaceFile::symbols ( ) const | inline |
|---|
◆ symbolsCount()
| size_t llvm::MachO::InterfaceFile::symbolsCount ( ) const | inline |
|---|
Get size of symbol set.
Returns
The number of symbols the file holds.
Definition at line 360 of file InterfaceFile.h.
◆ targets() [1/2]
| const_target_range llvm::MachO::InterfaceFile::targets ( ) const | inline |
|---|
◆ targets() [2/2]
◆ 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 251 of file InterfaceFile.h.
Referenced by extract(), merge(), and remove().
◆ undefineds()
| const_filtered_symbol_range llvm::MachO::InterfaceFile::undefineds ( ) const | inline |
|---|
The documentation for this class was generated from the following files:
- include/llvm/TextAPI/InterfaceFile.h
- lib/TextAPI/InterfaceFile.cpp