14#ifndef LLVM_TEXTAPI_INTERFACEFILE_H
15#define LLVM_TEXTAPI_INTERFACEFILE_H
92 template <
typename RangeT>
void addTargets(RangeT &&Targets) {
93 for (
const auto &
Target : Targets)
108 return std::tie(InstallName, Targets) == std::tie(O.InstallName, O.Targets);
112 return std::tie(InstallName, Targets) != std::tie(O.InstallName, O.Targets);
116 return std::tie(InstallName, Targets) < std::tie(O.InstallName, O.Targets);
120 std::string InstallName;
148 return std::tie(
LHS.Kind,
LHS.Name) == std::tie(
RHS.Kind,
RHS.Name);
202 template <
typename RangeT>
void addTargets(RangeT &&Targets) {
203 for (
const auto &Target_ : Targets)
220 InstallName = std::string(InstallName_);
234 CompatibilityVersion = Version;
260 ObjcConstraint = Constraint;
281 const std::vector<std::pair<Target, std::string>> &
umbrellas()
const {
282 return ParentUmbrellas;
301 return AllowableClients;
314 return ReexportedLibraries;
332 const std::vector<std::pair<Target, std::string>> &
uuids()
const {
339 void addDocument(std::shared_ptr<InterfaceFile> &&Document);
347 const std::vector<std::shared_ptr<InterfaceFile>> &
documents()
const {
359 const std::vector<std::pair<Target, std::string>> &
rpaths()
const {
370 const_symbol_iterator, SymbolMapType::const_iterator,
371 std::forward_iterator_tag, const Symbol *, ptrdiff_t,
372 const Symbol *, const Symbol *> {
375 template <
typename U>
392 return {Symbols.
begin(), Symbols.
end()};
402 make_range<const_symbol_iterator>({Symbols.
begin()}, {Symbols.
end()}),
411 make_range<const_symbol_iterator>({Symbols.
begin()}, {Symbols.
end()}),
420 make_range<const_symbol_iterator>({Symbols.
begin()}, {Symbols.
end()}),
446 std::string InstallName;
447 PackedVersion CurrentVersion;
448 PackedVersion CompatibilityVersion;
449 uint8_t SwiftABIVersion{0};
450 bool IsTwoLevelNamespace{
false};
451 bool IsAppExtensionSafe{
false};
452 bool IsInstallAPI{
false};
454 std::vector<std::pair<Target, std::string>> ParentUmbrellas;
455 std::vector<InterfaceFileRef> AllowableClients;
456 std::vector<InterfaceFileRef> ReexportedLibraries;
457 std::vector<std::shared_ptr<InterfaceFile>> Documents;
458 std::vector<std::pair<Target, std::string>> UUIDs;
459 std::vector<std::pair<Target, std::string>> RPaths;
461 InterfaceFile *Parent =
nullptr;
464template <
typename DerivedT,
typename KeyInfoT,
typename BucketT>
466 KeyInfoT, BucketT> &
LHS,
468 KeyInfoT, BucketT> &
RHS) {
469 if (
LHS.size() !=
RHS.size())
471 for (
const auto &KV :
LHS) {
472 auto I =
RHS.find(KV.first);
473 if (
I ==
RHS.end() || *
I->second != *KV.second)
This file defines the BumpPtrAllocator interface.
This file defines the DenseMap class.
std::pair< llvm::MachO::Target, std::string > UUID
Allocate memory in an ever growing pool, as if by bump-pointer.
Reference to an interface file.
InterfaceFileRef(StringRef InstallName, const TargetList Targets)
bool operator!=(const InterfaceFileRef &O) const
void addTargets(RangeT &&Targets)
PlatformSet getPlatforms() const
void addTarget(const Target &Target)
const_target_range targets() const
StringRef getInstallName() const
bool operator==(const InterfaceFileRef &O) const
ArchitectureSet getArchitectures() const
InterfaceFileRef(StringRef InstallName)
InterfaceFileRef()=default
bool operator<(const InterfaceFileRef &O) const
Defines the interface file.
void addDocument(std::shared_ptr< InterfaceFile > &&Document)
Add a library for inlining to top level library.
StringRef getPath() const
Get the path from which this file was generated (if applicable).
void addReexportedLibrary(StringRef InstallName, const Target &Target)
Add a re-exported library.
void setPath(StringRef Path_)
Set the path from which this file was generated (if applicable).
void addParentUmbrella(const Target &Target_, StringRef Parent)
Set the parent umbrella frameworks.
const_target_range targets() const
void setInstallAPI(bool V=true)
Specify if this file was generated during InstallAPI (or not).
const_filtered_symbol_range reexports() const
void setObjCConstraint(ObjCConstraintType Constraint)
Set the Objective-C constraint.
bool isTwoLevelNamespace() const
Check if the library uses two-level namespace.
bool operator==(const InterfaceFile &O) const
The equality is determined by attributes that impact linking compatibilities.
PackedVersion getCompatibilityVersion() const
Get the compatibility version of the library.
size_t symbolsCount() const
bool operator!=(const InterfaceFile &O) const
void addTarget(const Target &Target)
Set and add target.
const_filtered_symbol_range exports() const
bool isApplicationExtensionSafe() const
Check if the library is application extension safe.
const std::vector< std::pair< Target, std::string > > & uuids() const
Get the list of Target/UUID pairs.
PlatformSet getPlatforms() const
Get the platforms.
const std::vector< std::pair< Target, std::string > > & rpaths() const
Get the list of runpath search paths.
void addUUID(const Target &Target, StringRef UUID)
Add an Target/UUID pair.
const std::vector< InterfaceFileRef > & allowableClients() const
Get the list of allowable clients.
void setInstallName(StringRef InstallName_)
Set the install name of the library.
void addTargets(RangeT &&Targets)
Set and add targets.
const std::vector< std::shared_ptr< InterfaceFile > > & documents() const
Get the list of inlined libraries.
const std::vector< std::pair< Target, std::string > > & umbrellas() const
Get the list of Parent Umbrella frameworks.
const std::vector< InterfaceFileRef > & reexportedLibraries() const
Get the list of re-exported libraries.
InterfaceFile * getParent() const
Returns the pointer to parent document if exists or nullptr otherwise.
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.
const_symbol_range symbols() const
void setFileType(FileType Kind)
Set the file type.
uint8_t getSwiftABIVersion() const
Get the Swift ABI version of the library.
PackedVersion getCurrentVersion() const
Get the current version of the library.
const_filtered_symbol_range undefineds() const
void setCompatibilityVersion(PackedVersion Version)
Set the compatibility version of the library.
ArchitectureSet getArchitectures() const
Get the architectures.
StringRef getInstallName() const
Get the install name of the library.
ObjCConstraintType getObjCConstraint() const
Get the Objective-C constraint.
FileType getFileType() const
Get the file type.
void setApplicationExtensionSafe(bool V=true)
Specify if the library is application extension safe (or not).
void addAllowableClient(StringRef InstallName, const Target &Target)
Add an allowable client.
void setSwiftABIVersion(uint8_t Version)
Set the Swift ABI version of the library.
void addRPath(const Target &InputTarget, StringRef RPath)
Set the runpath search paths.
DenseMap< SymbolsMapKey, Symbol * > SymbolMapType
void setCurrentVersion(PackedVersion Version)
Set the current version of the library.
TargetList::const_iterator const_target_iterator
bool isInstallAPI() const
Check if this file was generated during InstallAPI.
void setTwoLevelNamespace(bool V=true)
Specify if the library uses two-level namespace (or flat namespace).
bool isReexported() const
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
StringRef - Represent a constant reference to a string, i.e.
Specialization of filter_iterator_base for forward iteration only.
CRTP base class for adapting an iterator to a different type.
SymbolMapType::const_iterator I
A range adaptor for a pair of iterators.
FileType
Defines the file type this file represents.
@ Invalid
Invalid file type.
@ TBD_V1
Text-based stub file (.tbd) version 1.0.
@ LLVM_MARK_AS_BITMASK_ENUM
@ TBD_V3
Text-based stub file (.tbd) version 3.0.
@ TBD_V5
Text-based stub file (.tbd) version 5.0.
@ TBD_V4
Text-based stub file (.tbd) version 4.0.
@ TBD_V2
Text-based stub file (.tbd) version 2.0.
@ ObjectiveCInstanceVariable
PlatformSet mapToPlatformSet(ArrayRef< Triple > Targets)
ObjCConstraintType
Defines a list of Objective-C constraints.
@ Retain_Release_For_Simulator
Retain/Release for Simulator.
@ Retain_Release_Or_GC
Retain/Release or Garbage Collection.
@ Retain_Release
Retain/Release.
bool operator==(const DenseMapBase< DerivedT, SymbolsMapKey, MachO::Symbol *, KeyInfoT, BucketT > &LHS, const DenseMapBase< DerivedT, SymbolsMapKey, MachO::Symbol *, KeyInfoT, BucketT > &RHS)
SmallVector< Target, 5 > TargetList
ArchitectureSet mapToArchitectureSet(ArrayRef< Target > Targets)
This is an optimization pass for GlobalISel generic memory operations.
hash_code hash_value(const FixedPointSemantics &Val)
iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > make_filter_range(RangeT &&Range, PredicateT Pred)
Convenience function that takes a range of elements and a predicate, and return a new filter_iterator...
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
static SymbolsMapKey getEmptyKey()
static SymbolsMapKey getTombstoneKey()
static bool isEqual(const SymbolsMapKey &LHS, const SymbolsMapKey &RHS)
static unsigned getHashValue(const SymbolsMapKey &Key)
An information struct used to provide DenseMap with the various necessary components for a given valu...
const_symbol_iterator(U &&u)
reference operator*() const
pointer operator->() const
const_symbol_iterator()=default
SymbolsMapKey(MachO::SymbolKind Kind, StringRef Name)