Go to the documentation of this file.
14 #ifndef LLVM_TEXTAPI_INTERFACEFILE_H
15 #define LLVM_TEXTAPI_INTERFACEFILE_H
84 : InstallName(InstallName), Targets(
std::
move(Targets)) {}
89 template <
typename RangeT>
void addTargets(RangeT &&Targets) {
90 for (
const auto &
Target : Targets)
105 return std::tie(InstallName, Targets) == std::tie(
O.InstallName,
O.Targets);
109 return std::tie(InstallName, Targets) != std::tie(
O.InstallName,
O.Targets);
113 return std::tie(InstallName, Targets) < std::tie(
O.InstallName,
O.Targets);
117 std::string InstallName;
145 return std::tie(
LHS.Kind,
LHS.Name) == std::tie(
RHS.Kind,
RHS.Name);
199 template <
typename RangeT>
void addTargets(RangeT &&Targets) {
200 for (
const auto &Target_ : Targets)
217 InstallName = std::string(InstallName_);
231 CompatibilityVersion =
Version;
257 ObjcConstraint = Constraint;
278 const std::vector<std::pair<Target, std::string>> &
umbrellas()
const {
279 return ParentUmbrellas;
298 return AllowableClients;
311 return ReexportedLibraries;
329 const std::vector<std::pair<Target, std::string>> &
uuids()
const {
336 void addDocument(std::shared_ptr<InterfaceFile> &&Document);
344 const std::vector<std::shared_ptr<InterfaceFile>> &
documents()
const {
355 const_symbol_iterator, SymbolMapType::const_iterator,
356 std::forward_iterator_tag, const Symbol *, ptrdiff_t,
357 const Symbol *, const Symbol *> {
360 template <
typename U>
377 return {Symbols.
begin(), Symbols.
end()};
387 make_range<const_symbol_iterator>({Symbols.
begin()}, {Symbols.
end()}),
396 make_range<const_symbol_iterator>({Symbols.
begin()}, {Symbols.
end()}),
415 memcpy(
Ptr, String.data(), String.size());
416 return StringRef(
reinterpret_cast<const char *
>(
Ptr), String.size());
422 std::string InstallName;
423 PackedVersion CurrentVersion;
424 PackedVersion CompatibilityVersion;
425 uint8_t SwiftABIVersion{0};
426 bool IsTwoLevelNamespace{
false};
427 bool IsAppExtensionSafe{
false};
428 bool IsInstallAPI{
false};
430 std::vector<std::pair<Target, std::string>> ParentUmbrellas;
431 std::vector<InterfaceFileRef> AllowableClients;
432 std::vector<InterfaceFileRef> ReexportedLibraries;
433 std::vector<std::shared_ptr<InterfaceFile>> Documents;
434 std::vector<std::pair<Target, std::string>> UUIDs;
436 InterfaceFile *Parent =
nullptr;
439 template <
typename DerivedT,
typename KeyInfoT,
typename BucketT>
441 KeyInfoT, BucketT> &
LHS,
443 KeyInfoT, BucketT> &
RHS) {
444 if (
LHS.size() !=
RHS.size())
446 for (
const auto &KV :
LHS) {
447 auto I =
RHS.find(KV.first);
448 if (
I ==
RHS.end() || *
I->second != *KV.second)
457 #endif // LLVM_TEXTAPI_INTERFACEFILE_H
bool operator==(const DenseMapBase< DerivedT, SymbolsMapKey, MachO::Symbol *, KeyInfoT, BucketT > &LHS, const DenseMapBase< DerivedT, SymbolsMapKey, MachO::Symbol *, KeyInfoT, BucketT > &RHS)
bool isApplicationExtensionSafe() const
Check if the library is application extension safe.
This is an optimization pass for GlobalISel generic memory operations.
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.
ArchitectureSet mapToArchitectureSet(ArrayRef< Target > Targets)
void addReexportedLibrary(StringRef InstallName, const Target &Target)
Add a re-exported library.
void addTarget(const Target &Target)
Set and add target.
const std::vector< InterfaceFileRef > & allowableClients() const
Get the list of allowable clients.
static SymbolsMapKey getEmptyKey()
SymbolMapType::const_iterator I
DenseMap< SymbolsMapKey, Symbol * > SymbolMapType
const_filtered_symbol_range exports() const
@ Invalid
Invalid file type.
void setFileType(FileType Kind)
Set the file type.
Specialization of filter_iterator_base for forward iteration only.
CRTP base class for adapting an iterator to a different type.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
FileType getFileType() const
Get the file type.
@ TBD_V3
Text-based stub file (.tbd) version 3.0.
@ Retain_Release_For_Simulator
Retain/Release for Simulator.
bool isInstallAPI() const
Check if this file was generated during InstallAPI.
StringRef getInstallName() const
void setTwoLevelNamespace(bool V=true)
Specify if the library uses two-level namespace (or flat namespace).
void setInstallName(StringRef InstallName_)
Set the install name of the library.
PackedVersion getCompatibilityVersion() const
Get the compatibility version of the library.
An information struct used to provide DenseMap with the various necessary components for a given valu...
SmallVector< Target, 5 > TargetList
StringRef getPath() const
Get the path from which this file was generated (if applicable).
bool operator==(const InterfaceFileRef &O) const
void addTargets(RangeT &&Targets)
void setPath(StringRef Path_)
Set the path from which this file was generated (if applicable).
static SymbolsMapKey getTombstoneKey()
void setSwiftABIVersion(uint8_t Version)
Set the Swift ABI version of the library.
size_t symbolsCount() const
bool isTwoLevelNamespace() const
Check if the library uses two-level namespace.
void setCurrentVersion(PackedVersion Version)
Set the current version of the library.
const_target_range targets() const
bool operator!=(const InterfaceFile &O) const
pointer operator->() const
InterfaceFileRef(StringRef InstallName, const TargetList Targets)
@ TBD_V1
Text-based stub file (.tbd) version 1.0.
const std::vector< std::pair< Target, std::string > > & umbrellas() const
Get the list of Parent Umbrella frameworks.
const_target_range targets() const
FileType
Defines the file type this file represents.
ObjCConstraintType
Defines a list of Objective-C constraints.
const_filtered_symbol_range undefineds() const
void addTarget(const Target &Target)
void setObjCConstraint(ObjCConstraintType Constraint)
Set the Objective-C constraint.
@ Retain_Release_Or_GC
Retain/Release or Garbage Collection.
@ TBD_V2
Text-based stub file (.tbd) version 2.0.
InterfaceFileRef()=default
bool operator!=(const InterfaceFileRef &O) const
bool operator==(const InterfaceFile &O) const
The equality is determined by attributes that impact linking compatibilities.
@ ObjectiveCInstanceVariable
Allocate memory in an ever growing pool, as if by bump-pointer.
Defines the interface file.
InterfaceFileRef(StringRef InstallName)
typename SuperClass::const_iterator const_iterator
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
<%struct.s * > cast struct s *S to sbyte *< sbyte * > sbyte uint cast struct s *agg result to sbyte *< sbyte * > sbyte uint cast struct s *memtmp to sbyte *< sbyte * > sbyte uint ret void llc ends up issuing two memcpy or custom lower memcpy(of small size) to be ldmia/stmia. I think option 2 is better but the current register allocator cannot allocate a chunk of registers at a time. A feasible temporary solution is to use specific physical registers at the lowering time for small(<
const std::vector< InterfaceFileRef > & reexportedLibraries() const
Get the list of re-exported libraries.
StringRef getInstallName() const
Get the install name of the library.
const_symbol_range symbols() const
Reference to an interface file.
print Print MemDeps of function
std::pair< llvm::MachO::Target, std::string > UUID
uint8_t getSwiftABIVersion() const
Get the Swift ABI version of the library.
reference operator*() const
PackedVersion getCurrentVersion() const
Get the current version of the library.
@ TBD_V4
Text-based stub file (.tbd) version 4.0.
const std::vector< std::shared_ptr< InterfaceFile > > & documents() const
Get the list of inlined libraries.
TargetList::const_iterator const_target_iterator
bool operator<(const InterfaceFileRef &O) const
void setInstallAPI(bool V=true)
Specify if this file was generated during InstallAPI (or not).
StringRef - Represent a constant reference to a string, i.e.
SymbolsMapKey(MachO::SymbolKind Kind, StringRef Name)
@ LLVM_MARK_AS_BITMASK_ENUM
ArchitectureSet getArchitectures() const
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...
TargetList::const_iterator const_target_iterator
void addTargets(RangeT &&Targets)
Set and add targets.
void setCompatibilityVersion(PackedVersion Version)
Set the compatibility version of the library.
ObjCConstraintType getObjCConstraint() const
Get the Objective-C constraint.
const_symbol_iterator()=default
ArchitectureSet getArchitectures() const
Get the architectures.
void addAllowableClient(StringRef InstallName, const Target &Target)
Add an allowable client.
void setApplicationExtensionSafe(bool V=true)
Specify if the library is application extension safe (or not).
void addUUID(const Target &Target, StringRef UUID)
Add an Target/UUID pair.
PlatformSet getPlatforms() const
static bool isEqual(const SymbolsMapKey &LHS, const SymbolsMapKey &RHS)
hash_code hash_value(const FixedPointSemantics &Val)
static unsigned getHashValue(const SymbolsMapKey &Key)
@ Retain_Release
Retain/Release.
PlatformSet mapToPlatformSet(ArrayRef< Triple > Targets)
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
void addParentUmbrella(const Target &Target_, StringRef Parent)
Set the parent umbrella frameworks.
A range adaptor for a pair of iterators.
void addDocument(std::shared_ptr< InterfaceFile > &&Document)
Add a library for inlining to top level library.
llvm::filter_iterator< const_target_iterator, std::function< bool(const Target &)> > const_filtered_target_iterator
const std::vector< std::pair< Target, std::string > > & uuids() const
Get the list of Target/UUID pairs.
const_symbol_iterator(U &&u)
PlatformSet getPlatforms() const
Get the platforms.
InterfaceFile * getParent() const
Returns the pointer to parent document if exists or nullptr otherwise.