LLVM  16.0.0git
InterfaceFile.h
Go to the documentation of this file.
1 //===- llvm/TextAPI/InterfaceFile.h - TAPI Interface File -------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // A generic and abstract interface representation for linkable objects. This
10 // could be an MachO executable, bundle, dylib, or text-based stub file.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TEXTAPI_INTERFACEFILE_H
15 #define LLVM_TEXTAPI_INTERFACEFILE_H
16 
17 #include "llvm/ADT/BitmaskEnum.h"
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/Hashing.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/ADT/iterator.h"
22 #include "llvm/Support/Allocator.h"
25 #include "llvm/TextAPI/Platform.h"
26 #include "llvm/TextAPI/Symbol.h"
27 #include "llvm/TextAPI/Target.h"
28 
29 namespace llvm {
30 namespace MachO {
31 
32 /// Defines a list of Objective-C constraints.
33 enum class ObjCConstraintType : unsigned {
34  /// No constraint.
35  None = 0,
36 
37  /// Retain/Release.
38  Retain_Release = 1,
39 
40  /// Retain/Release for Simulator.
42 
43  /// Retain/Release or Garbage Collection.
45 
46  /// Garbage Collection.
47  GC = 4,
48 };
49 
50 // clang-format off
51 
52 /// Defines the file type this file represents.
53 enum FileType : unsigned {
54  /// Invalid file type.
55  Invalid = 0U,
56 
57  /// Text-based stub file (.tbd) version 1.0
58  TBD_V1 = 1U << 0,
59 
60  /// Text-based stub file (.tbd) version 2.0
61  TBD_V2 = 1U << 1,
62 
63  /// Text-based stub file (.tbd) version 3.0
64  TBD_V3 = 1U << 2,
65 
66  /// Text-based stub file (.tbd) version 4.0
67  TBD_V4 = 1U << 3,
68 
69  All = ~0U,
70 
71  LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/All),
72 };
73 
74 // clang-format on
75 
76 /// Reference to an interface file.
78 public:
79  InterfaceFileRef() = default;
80 
81  InterfaceFileRef(StringRef InstallName) : InstallName(InstallName) {}
82 
83  InterfaceFileRef(StringRef InstallName, const TargetList Targets)
84  : InstallName(InstallName), Targets(std::move(Targets)) {}
85 
86  StringRef getInstallName() const { return InstallName; };
87 
88  void addTarget(const Target &Target);
89  template <typename RangeT> void addTargets(RangeT &&Targets) {
90  for (const auto &Target : Targets)
92  }
93 
96  const_target_range targets() const { return {Targets}; }
97 
99  return mapToArchitectureSet(Targets);
100  }
101 
102  PlatformSet getPlatforms() const { return mapToPlatformSet(Targets); }
103 
104  bool operator==(const InterfaceFileRef &O) const {
105  return std::tie(InstallName, Targets) == std::tie(O.InstallName, O.Targets);
106  }
107 
108  bool operator!=(const InterfaceFileRef &O) const {
109  return std::tie(InstallName, Targets) != std::tie(O.InstallName, O.Targets);
110  }
111 
112  bool operator<(const InterfaceFileRef &O) const {
113  return std::tie(InstallName, Targets) < std::tie(O.InstallName, O.Targets);
114  }
115 
116 private:
117  std::string InstallName;
118  TargetList Targets;
119 };
120 
121 } // end namespace MachO.
122 
126 
128  : Kind(Kind), Name(Name) {}
129 };
130 template <> struct DenseMapInfo<SymbolsMapKey> {
131  static inline SymbolsMapKey getEmptyKey() {
133  }
134 
135  static inline SymbolsMapKey getTombstoneKey() {
137  StringRef{});
138  }
139 
140  static unsigned getHashValue(const SymbolsMapKey &Key) {
141  return hash_combine(hash_value(Key.Kind), hash_value(Key.Name));
142  }
143 
144  static bool isEqual(const SymbolsMapKey &LHS, const SymbolsMapKey &RHS) {
145  return std::tie(LHS.Kind, LHS.Name) == std::tie(RHS.Kind, RHS.Name);
146  }
147 };
148 
149 namespace MachO {
150 
151 /// Defines the interface file.
153 public:
154  /// Set the path from which this file was generated (if applicable).
155  ///
156  /// \param Path_ The path to the source file.
157  void setPath(StringRef Path_) { Path = std::string(Path_); }
158 
159  /// Get the path from which this file was generated (if applicable).
160  ///
161  /// \return The path to the source file or empty.
162  StringRef getPath() const { return Path; }
163 
164  /// Set the file type.
165  ///
166  /// This is used by the YAML writer to identify the specification it should
167  /// use for writing the file.
168  ///
169  /// \param Kind The file type.
170  void setFileType(FileType Kind) { FileKind = Kind; }
171 
172  /// Get the file type.
173  ///
174  /// \return The file type.
175  FileType getFileType() const { return FileKind; }
176 
177  /// Get the architectures.
178  ///
179  /// \return The applicable architectures.
181  return mapToArchitectureSet(Targets);
182  }
183 
184  /// Get the platforms.
185  ///
186  /// \return The applicable platforms.
187  PlatformSet getPlatforms() const { return mapToPlatformSet(Targets); }
188 
189  /// Set and add target.
190  ///
191  /// \param Target the target to add into.
192  void addTarget(const Target &Target);
193 
194  /// Set and add targets.
195  ///
196  /// Add the subset of llvm::triples that is supported by Tapi
197  ///
198  /// \param Targets the collection of targets.
199  template <typename RangeT> void addTargets(RangeT &&Targets) {
200  for (const auto &Target_ : Targets)
201  addTarget(Target(Target_));
202  }
203 
206  const_target_range targets() const { return {Targets}; }
207 
210  std::function<bool(const Target &)>>;
214 
215  /// Set the install name of the library.
216  void setInstallName(StringRef InstallName_) {
217  InstallName = std::string(InstallName_);
218  }
219 
220  /// Get the install name of the library.
221  StringRef getInstallName() const { return InstallName; }
222 
223  /// Set the current version of the library.
224  void setCurrentVersion(PackedVersion Version) { CurrentVersion = Version; }
225 
226  /// Get the current version of the library.
227  PackedVersion getCurrentVersion() const { return CurrentVersion; }
228 
229  /// Set the compatibility version of the library.
231  CompatibilityVersion = Version;
232  }
233 
234  /// Get the compatibility version of the library.
235  PackedVersion getCompatibilityVersion() const { return CompatibilityVersion; }
236 
237  /// Set the Swift ABI version of the library.
238  void setSwiftABIVersion(uint8_t Version) { SwiftABIVersion = Version; }
239 
240  /// Get the Swift ABI version of the library.
241  uint8_t getSwiftABIVersion() const { return SwiftABIVersion; }
242 
243  /// Specify if the library uses two-level namespace (or flat namespace).
244  void setTwoLevelNamespace(bool V = true) { IsTwoLevelNamespace = V; }
245 
246  /// Check if the library uses two-level namespace.
247  bool isTwoLevelNamespace() const { return IsTwoLevelNamespace; }
248 
249  /// Specify if the library is application extension safe (or not).
250  void setApplicationExtensionSafe(bool V = true) { IsAppExtensionSafe = V; }
251 
252  /// Check if the library is application extension safe.
253  bool isApplicationExtensionSafe() const { return IsAppExtensionSafe; }
254 
255  /// Set the Objective-C constraint.
257  ObjcConstraint = Constraint;
258  }
259 
260  /// Get the Objective-C constraint.
261  ObjCConstraintType getObjCConstraint() const { return ObjcConstraint; }
262 
263  /// Specify if this file was generated during InstallAPI (or not).
264  void setInstallAPI(bool V = true) { IsInstallAPI = V; }
265 
266  /// Check if this file was generated during InstallAPI.
267  bool isInstallAPI() const { return IsInstallAPI; }
268 
269  /// Set the parent umbrella frameworks.
270  /// \param Target_ The target applicable to Parent
271  /// \param Parent The name of Parent
272  void addParentUmbrella(const Target &Target_, StringRef Parent);
273 
274  /// Get the list of Parent Umbrella frameworks.
275  ///
276  /// \return Returns a list of target information and install name of parent
277  /// umbrellas.
278  const std::vector<std::pair<Target, std::string>> &umbrellas() const {
279  return ParentUmbrellas;
280  }
281 
282  /// Add an allowable client.
283  ///
284  /// Mach-O Dynamic libraries have the concept of allowable clients that are
285  /// checked during static link time. The name of the application or library
286  /// that is being generated needs to match one of the allowable clients or the
287  /// linker refuses to link this library.
288  ///
289  /// \param InstallName The name of the client that is allowed to link this
290  /// library.
291  /// \param Target The target triple for which this applies.
292  void addAllowableClient(StringRef InstallName, const Target &Target);
293 
294  /// Get the list of allowable clients.
295  ///
296  /// \return Returns a list of allowable clients.
297  const std::vector<InterfaceFileRef> &allowableClients() const {
298  return AllowableClients;
299  }
300 
301  /// Add a re-exported library.
302  ///
303  /// \param InstallName The name of the library to re-export.
304  /// \param Target The target triple for which this applies.
305  void addReexportedLibrary(StringRef InstallName, const Target &Target);
306 
307  /// Get the list of re-exported libraries.
308  ///
309  /// \return Returns a list of re-exported libraries.
310  const std::vector<InterfaceFileRef> &reexportedLibraries() const {
311  return ReexportedLibraries;
312  }
313 
314  /// Add an Target/UUID pair.
315  ///
316  /// \param Target The target triple for which this applies.
317  /// \param UUID The UUID of the library for the specified architecture.
318  void addUUID(const Target &Target, StringRef UUID);
319 
320  /// Add an Target/UUID pair.
321  ///
322  /// \param Target The target triple for which this applies.
323  /// \param UUID The UUID of the library for the specified architecture.
324  void addUUID(const Target &Target, uint8_t UUID[16]);
325 
326  /// Get the list of Target/UUID pairs.
327  ///
328  /// \return Returns a list of Target/UUID pairs.
329  const std::vector<std::pair<Target, std::string>> &uuids() const {
330  return UUIDs;
331  }
332 
333  /// Add a library for inlining to top level library.
334  ///
335  ///\param Document The library to inline with top level library.
336  void addDocument(std::shared_ptr<InterfaceFile> &&Document);
337 
338  /// Returns the pointer to parent document if exists or nullptr otherwise.
339  InterfaceFile *getParent() const { return Parent; }
340 
341  /// Get the list of inlined libraries.
342  ///
343  /// \return Returns a list of the inlined frameworks.
344  const std::vector<std::shared_ptr<InterfaceFile>> &documents() const {
345  return Documents;
346  }
347 
348  /// Add a symbol to the symbols list or extend an existing one.
349  void addSymbol(SymbolKind Kind, StringRef Name, const TargetList &Targets,
351 
354  : public iterator_adaptor_base<
355  const_symbol_iterator, SymbolMapType::const_iterator,
356  std::forward_iterator_tag, const Symbol *, ptrdiff_t,
357  const Symbol *, const Symbol *> {
358  const_symbol_iterator() = default;
359 
360  template <typename U>
362  : iterator_adaptor_base(std::forward<U &&>(u)) {}
363 
364  reference operator*() const { return I->second; }
365  pointer operator->() const { return I->second; }
366  };
367 
369 
372  std::function<bool(const Symbol *)>>;
375 
377  return {Symbols.begin(), Symbols.end()};
378  }
379 
380  size_t symbolsCount() const { return Symbols.size(); }
381 
383  std::function<bool(const Symbol *)> fn = [](const Symbol *Symbol) {
384  return !Symbol->isUndefined();
385  };
386  return make_filter_range(
387  make_range<const_symbol_iterator>({Symbols.begin()}, {Symbols.end()}),
388  fn);
389  }
390 
392  std::function<bool(const Symbol *)> fn = [](const Symbol *Symbol) {
393  return Symbol->isUndefined();
394  };
395  return make_filter_range(
396  make_range<const_symbol_iterator>({Symbols.begin()}, {Symbols.end()}),
397  fn);
398  }
399 
400  /// The equality is determined by attributes that impact linking
401  /// compatibilities. UUIDs, Path, & FileKind are irrelevant since these by
402  /// itself should not impact linking.
403  /// This is an expensive operation.
404  bool operator==(const InterfaceFile &O) const;
405 
406  bool operator!=(const InterfaceFile &O) const { return !(*this == O); }
407 
408 private:
409  llvm::BumpPtrAllocator Allocator;
410  StringRef copyString(StringRef String) {
411  if (String.empty())
412  return {};
413 
414  void *Ptr = Allocator.Allocate(String.size(), 1);
415  memcpy(Ptr, String.data(), String.size());
416  return StringRef(reinterpret_cast<const char *>(Ptr), String.size());
417  }
418 
419  TargetList Targets;
420  std::string Path;
421  FileType FileKind;
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;
435  SymbolMapType Symbols;
436  InterfaceFile *Parent = nullptr;
437 };
438 
439 template <typename DerivedT, typename KeyInfoT, typename BucketT>
441  KeyInfoT, BucketT> &LHS,
442  const DenseMapBase<DerivedT, SymbolsMapKey, MachO::Symbol *,
443  KeyInfoT, BucketT> &RHS) {
444  if (LHS.size() != RHS.size())
445  return false;
446  for (const auto &KV : LHS) {
447  auto I = RHS.find(KV.first);
448  if (I == RHS.end() || *I->second != *KV.second)
449  return false;
450  }
451  return true;
452 }
453 
454 } // end namespace MachO.
455 } // end namespace llvm.
456 
457 #endif // LLVM_TEXTAPI_INTERFACEFILE_H
llvm::MachO::operator==
bool operator==(const DenseMapBase< DerivedT, SymbolsMapKey, MachO::Symbol *, KeyInfoT, BucketT > &LHS, const DenseMapBase< DerivedT, SymbolsMapKey, MachO::Symbol *, KeyInfoT, BucketT > &RHS)
Definition: InterfaceFile.h:440
llvm::MachO::InterfaceFile::isApplicationExtensionSafe
bool isApplicationExtensionSafe() const
Check if the library is application extension safe.
Definition: InterfaceFile.h:253
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MachO::InterfaceFile::addSymbol
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.
Definition: InterfaceFile.cpp:110
llvm::MachO::mapToArchitectureSet
ArchitectureSet mapToArchitectureSet(ArrayRef< Target > Targets)
Definition: Target.cpp:65
StringRef.h
llvm::MachO::InterfaceFile::addReexportedLibrary
void addReexportedLibrary(StringRef InstallName, const Target &Target)
Add a re-exported library.
Definition: InterfaceFile.cpp:55
llvm::MachO::InterfaceFile::addTarget
void addTarget(const Target &Target)
Set and add target.
Definition: InterfaceFile.cpp:98
llvm::iterator_facade_base< const_symbol_iterator, std::forward_iterator_tag, const Symbol *, ptrdiff_t, const Symbol *, const Symbol * >::pointer
const Symbol * pointer
Definition: iterator.h:85
llvm::MachO::InterfaceFile::allowableClients
const std::vector< InterfaceFileRef > & allowableClients() const
Get the list of allowable clients.
Definition: InterfaceFile.h:297
llvm::SmallVector< Target, 5 >
llvm::MachO::Target
Definition: Target.h:26
llvm::DenseMapInfo< SymbolsMapKey >::getEmptyKey
static SymbolsMapKey getEmptyKey()
Definition: InterfaceFile.h:131
llvm::iterator_adaptor_base< const_symbol_iterator, SymbolMapType::const_iterator, std::forward_iterator_tag, const Symbol *, ptrdiff_t, const Symbol *, const Symbol * >::I
SymbolMapType::const_iterator I
Definition: iterator.h:241
Allocator.h
llvm::MachO::InterfaceFile::SymbolMapType
DenseMap< SymbolsMapKey, Symbol * > SymbolMapType
Definition: InterfaceFile.h:352
llvm::MachO::InterfaceFile::exports
const_filtered_symbol_range exports() const
Definition: InterfaceFile.h:382
llvm::MachO::Invalid
@ Invalid
Invalid file type.
Definition: InterfaceFile.h:55
llvm::MachO::InterfaceFile::setFileType
void setFileType(FileType Kind)
Set the file type.
Definition: InterfaceFile.h:170
llvm::MachO::SymbolKind
SymbolKind
Definition: Symbol.h:48
llvm::DenseMapBase::begin
iterator begin()
Definition: DenseMap.h:75
DenseMap.h
llvm::filter_iterator_impl
Specialization of filter_iterator_base for forward iteration only.
Definition: STLExtras.h:440
llvm::iterator_adaptor_base
CRTP base class for adapting an iterator to a different type.
Definition: iterator.h:235
llvm::SmallSet
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Definition: SmallSet.h:136
llvm::MachO::InterfaceFile::getFileType
FileType getFileType() const
Get the file type.
Definition: InterfaceFile.h:175
llvm::MachO::TBD_V3
@ TBD_V3
Text-based stub file (.tbd) version 3.0.
Definition: InterfaceFile.h:64
llvm::SymbolsMapKey
Definition: InterfaceFile.h:123
llvm::MachO::ObjCConstraintType::Retain_Release_For_Simulator
@ Retain_Release_For_Simulator
Retain/Release for Simulator.
llvm::MachO::InterfaceFile::isInstallAPI
bool isInstallAPI() const
Check if this file was generated during InstallAPI.
Definition: InterfaceFile.h:267
Hashing.h
llvm::MachO::InterfaceFileRef::getInstallName
StringRef getInstallName() const
Definition: InterfaceFile.h:86
RHS
Value * RHS
Definition: X86PartialReduction.cpp:76
llvm::hash_value
hash_code hash_value(const APFloat &Arg)
See friend declarations above.
Definition: APFloat.cpp:4828
llvm::MachO::InterfaceFile::const_symbol_iterator
Definition: InterfaceFile.h:353
llvm::MachO::SymbolFlags
SymbolFlags
Symbol flags.
Definition: Symbol.h:24
llvm::MachO::InterfaceFile::setTwoLevelNamespace
void setTwoLevelNamespace(bool V=true)
Specify if the library uses two-level namespace (or flat namespace).
Definition: InterfaceFile.h:244
Target.h
llvm::MachO::InterfaceFile::setInstallName
void setInstallName(StringRef InstallName_)
Set the install name of the library.
Definition: InterfaceFile.h:216
llvm::MachO::InterfaceFile::getCompatibilityVersion
PackedVersion getCompatibilityVersion() const
Get the compatibility version of the library.
Definition: InterfaceFile.h:235
LHS
Value * LHS
Definition: X86PartialReduction.cpp:75
llvm::DenseMapInfo
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition: APInt.h:34
llvm::MachO::TargetList
SmallVector< Target, 5 > TargetList
Definition: Symbol.h:61
llvm::MachO::InterfaceFile::getPath
StringRef getPath() const
Get the path from which this file was generated (if applicable).
Definition: InterfaceFile.h:162
llvm::MachO::InterfaceFileRef::operator==
bool operator==(const InterfaceFileRef &O) const
Definition: InterfaceFile.h:104
llvm::MachO::InterfaceFileRef::addTargets
void addTargets(RangeT &&Targets)
Definition: InterfaceFile.h:89
llvm::MachO::InterfaceFile::setPath
void setPath(StringRef Path_)
Set the path from which this file was generated (if applicable).
Definition: InterfaceFile.h:157
llvm::DenseMapInfo< SymbolsMapKey >::getTombstoneKey
static SymbolsMapKey getTombstoneKey()
Definition: InterfaceFile.h:135
Platform.h
llvm::MachO::InterfaceFile::setSwiftABIVersion
void setSwiftABIVersion(uint8_t Version)
Set the Swift ABI version of the library.
Definition: InterfaceFile.h:238
llvm::MachO::InterfaceFile::symbolsCount
size_t symbolsCount() const
Definition: InterfaceFile.h:380
llvm::MachO::InterfaceFile::isTwoLevelNamespace
bool isTwoLevelNamespace() const
Check if the library uses two-level namespace.
Definition: InterfaceFile.h:247
llvm::MachO::InterfaceFile::setCurrentVersion
void setCurrentVersion(PackedVersion Version)
Set the current version of the library.
Definition: InterfaceFile.h:224
llvm::MachO::InterfaceFileRef::targets
const_target_range targets() const
Definition: InterfaceFile.h:96
llvm::AMDGPU::PALMD::Key
Key
PAL metadata keys.
Definition: AMDGPUMetadata.h:486
llvm::MachO::SymbolKind::GlobalSymbol
@ GlobalSymbol
llvm::MachO::InterfaceFile::operator!=
bool operator!=(const InterfaceFile &O) const
Definition: InterfaceFile.h:406
llvm::MachO::InterfaceFile::const_symbol_iterator::operator->
pointer operator->() const
Definition: InterfaceFile.h:365
llvm::IndexedInstrProf::Version
const uint64_t Version
Definition: InstrProf.h:1056
llvm::MachO::InterfaceFileRef::InterfaceFileRef
InterfaceFileRef(StringRef InstallName, const TargetList Targets)
Definition: InterfaceFile.h:83
llvm::DenseMapBase
Definition: DenseMap.h:61
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::MachO::TBD_V1
@ TBD_V1
Text-based stub file (.tbd) version 1.0.
Definition: InterfaceFile.h:58
llvm::MachO::InterfaceFile::umbrellas
const std::vector< std::pair< Target, std::string > > & umbrellas() const
Get the list of Parent Umbrella frameworks.
Definition: InterfaceFile.h:278
llvm::iterator_facade_base< const_symbol_iterator, std::forward_iterator_tag, const Symbol *, ptrdiff_t, const Symbol *, const Symbol * >::reference
const Symbol * reference
Definition: iterator.h:86
llvm::MachO::InterfaceFile::targets
const_target_range targets() const
Definition: InterfaceFile.h:206
llvm::MachO::FileType
FileType
Defines the file type this file represents.
Definition: InterfaceFile.h:53
llvm::MachO::ObjCConstraintType
ObjCConstraintType
Defines a list of Objective-C constraints.
Definition: InterfaceFile.h:33
llvm::MachO::InterfaceFile::undefineds
const_filtered_symbol_range undefineds() const
Definition: InterfaceFile.h:391
llvm::MachO::ArchitectureSet
Definition: ArchitectureSet.h:29
llvm::MachO::InterfaceFileRef::addTarget
void addTarget(const Target &Target)
Definition: InterfaceFile.cpp:45
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:264
llvm::MachO::InterfaceFile::setObjCConstraint
void setObjCConstraint(ObjCConstraintType Constraint)
Set the Objective-C constraint.
Definition: InterfaceFile.h:256
llvm::MachO::ObjCConstraintType::Retain_Release_Or_GC
@ Retain_Release_Or_GC
Retain/Release or Garbage Collection.
llvm::MachO::TBD_V2
@ TBD_V2
Text-based stub file (.tbd) version 2.0.
Definition: InterfaceFile.h:61
llvm::MachO::InterfaceFileRef::InterfaceFileRef
InterfaceFileRef()=default
llvm::MachO::InterfaceFileRef::operator!=
bool operator!=(const InterfaceFileRef &O) const
Definition: InterfaceFile.h:108
llvm::MachO::InterfaceFile::operator==
bool operator==(const InterfaceFile &O) const
The equality is determined by attributes that impact linking compatibilities.
Definition: InterfaceFile.cpp:131
llvm::MachO::SymbolKind::ObjectiveCInstanceVariable
@ ObjectiveCInstanceVariable
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:63
llvm::DenseMap< SymbolsMapKey, Symbol * >
iterator.h
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::MachO::InterfaceFile
Defines the interface file.
Definition: InterfaceFile.h:152
llvm::MachO::InterfaceFileRef::InterfaceFileRef
InterfaceFileRef(StringRef InstallName)
Definition: InterfaceFile.h:81
llvm::MachO::ObjCConstraintType::GC
@ GC
Garbage Collection.
llvm::SmallVectorImpl< Target >::const_iterator
typename SuperClass::const_iterator const_iterator
Definition: SmallVector.h:565
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1666
memcpy
<%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(<
llvm::MachO::InterfaceFile::reexportedLibraries
const std::vector< InterfaceFileRef > & reexportedLibraries() const
Get the list of re-exported libraries.
Definition: InterfaceFile.h:310
llvm::MachO::InterfaceFile::getInstallName
StringRef getInstallName() const
Get the install name of the library.
Definition: InterfaceFile.h:221
Ptr
@ Ptr
Definition: TargetLibraryInfo.cpp:60
llvm::MachO::InterfaceFile::symbols
const_symbol_range symbols() const
Definition: InterfaceFile.h:376
llvm::MachO::InterfaceFileRef
Reference to an interface file.
Definition: InterfaceFile.h:77
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:82
UUID
std::pair< llvm::MachO::Target, std::string > UUID
Definition: TextStubCommon.h:23
Symbol.h
llvm::MachO::InterfaceFile::getSwiftABIVersion
uint8_t getSwiftABIVersion() const
Get the Swift ABI version of the library.
Definition: InterfaceFile.h:241
llvm::MachO::InterfaceFile::const_symbol_iterator::operator*
reference operator*() const
Definition: InterfaceFile.h:364
llvm::MachO::InterfaceFile::getCurrentVersion
PackedVersion getCurrentVersion() const
Get the current version of the library.
Definition: InterfaceFile.h:227
llvm::MachO::TBD_V4
@ TBD_V4
Text-based stub file (.tbd) version 4.0.
Definition: InterfaceFile.h:67
llvm::MachO::InterfaceFile::documents
const std::vector< std::shared_ptr< InterfaceFile > > & documents() const
Get the list of inlined libraries.
Definition: InterfaceFile.h:344
llvm::MachO::InterfaceFileRef::const_target_iterator
TargetList::const_iterator const_target_iterator
Definition: InterfaceFile.h:94
llvm::MachO::PackedVersion
Definition: PackedVersion.h:25
llvm::MachO::InterfaceFileRef::operator<
bool operator<(const InterfaceFileRef &O) const
Definition: InterfaceFile.h:112
llvm::MachO::InterfaceFile::setInstallAPI
void setInstallAPI(bool V=true)
Specify if this file was generated during InstallAPI (or not).
Definition: InterfaceFile.h:264
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
BitmaskEnum.h
llvm::SymbolsMapKey::SymbolsMapKey
SymbolsMapKey(MachO::SymbolKind Kind, StringRef Name)
Definition: InterfaceFile.h:127
llvm::MachO::LLVM_MARK_AS_BITMASK_ENUM
@ LLVM_MARK_AS_BITMASK_ENUM
Definition: InterfaceFile.h:71
llvm::MachO::Symbol
Definition: Symbol.h:62
llvm::MachO::InterfaceFileRef::getArchitectures
ArchitectureSet getArchitectures() const
Definition: InterfaceFile.h:98
llvm::make_filter_range
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...
Definition: STLExtras.h:512
llvm::MachO::All
@ All
Definition: InterfaceFile.h:69
llvm::MachO::InterfaceFile::const_target_iterator
TargetList::const_iterator const_target_iterator
Definition: InterfaceFile.h:204
llvm::MachO::ObjCConstraintType::None
@ None
No constraint.
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
std
Definition: BitVector.h:851
llvm::MachO::InterfaceFile::addTargets
void addTargets(RangeT &&Targets)
Set and add targets.
Definition: InterfaceFile.h:199
llvm::MachO::InterfaceFile::setCompatibilityVersion
void setCompatibilityVersion(PackedVersion Version)
Set the compatibility version of the library.
Definition: InterfaceFile.h:230
llvm::DenseMapBase::end
iterator end()
Definition: DenseMap.h:84
llvm::MachO::InterfaceFile::getObjCConstraint
ObjCConstraintType getObjCConstraint() const
Get the Objective-C constraint.
Definition: InterfaceFile.h:261
llvm::MachO::InterfaceFile::const_symbol_iterator::const_symbol_iterator
const_symbol_iterator()=default
llvm::MachO::InterfaceFile::getArchitectures
ArchitectureSet getArchitectures() const
Get the architectures.
Definition: InterfaceFile.h:180
llvm::MachO::InterfaceFile::addAllowableClient
void addAllowableClient(StringRef InstallName, const Target &Target)
Add an allowable client.
Definition: InterfaceFile.cpp:49
llvm::MachO::InterfaceFile::setApplicationExtensionSafe
void setApplicationExtensionSafe(bool V=true)
Specify if the library is application extension safe (or not).
Definition: InterfaceFile.h:250
llvm::MachO::InterfaceFile::addUUID
void addUUID(const Target &Target, StringRef UUID)
Add an Target/UUID pair.
Definition: InterfaceFile.cpp:74
llvm::MachO::InterfaceFileRef::getPlatforms
PlatformSet getPlatforms() const
Definition: InterfaceFile.h:102
llvm::DenseMapBase::size
unsigned size() const
Definition: DenseMap.h:99
PackedVersion.h
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:83
llvm::DenseMapInfo< SymbolsMapKey >::isEqual
static bool isEqual(const SymbolsMapKey &LHS, const SymbolsMapKey &RHS)
Definition: InterfaceFile.h:144
llvm::DenseMapInfo< SymbolsMapKey >::getHashValue
static unsigned getHashValue(const SymbolsMapKey &Key)
Definition: InterfaceFile.h:140
llvm::MachO::ObjCConstraintType::Retain_Release
@ Retain_Release
Retain/Release.
llvm::MachO::mapToPlatformSet
PlatformSet mapToPlatformSet(ArrayRef< Triple > Targets)
Definition: Platform.cpp:56
llvm::hash_combine
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
Definition: Hashing.h:605
Allocator
Basic Register Allocator
Definition: RegAllocBasic.cpp:143
llvm::SymbolsMapKey::Name
StringRef Name
Definition: InterfaceFile.h:125
llvm::MachO::InterfaceFile::addParentUmbrella
void addParentUmbrella(const Target &Target_, StringRef Parent)
Set the parent umbrella frameworks.
Definition: InterfaceFile.cpp:61
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
ArchitectureSet.h
llvm::MachO::InterfaceFile::addDocument
void addDocument(std::shared_ptr< InterfaceFile > &&Document)
Add a library for inlining to top level library.
Definition: InterfaceFile.cpp:121
llvm::SymbolsMapKey::Kind
MachO::SymbolKind Kind
Definition: InterfaceFile.h:124
llvm::MachO::SymbolFlags::None
@ None
No flags.
llvm::MachO::Symbol::isUndefined
bool isUndefined() const
Definition: Symbol.h:88
llvm::MachO::InterfaceFile::const_filtered_target_iterator
llvm::filter_iterator< const_target_iterator, std::function< bool(const Target &)> > const_filtered_target_iterator
Definition: InterfaceFile.h:210
llvm::MachO::InterfaceFile::uuids
const std::vector< std::pair< Target, std::string > > & uuids() const
Get the list of Target/UUID pairs.
Definition: InterfaceFile.h:329
llvm::MachO::InterfaceFile::const_symbol_iterator::const_symbol_iterator
const_symbol_iterator(U &&u)
Definition: InterfaceFile.h:361
llvm::MachO::InterfaceFile::getPlatforms
PlatformSet getPlatforms() const
Get the platforms.
Definition: InterfaceFile.h:187
llvm::MachO::InterfaceFile::getParent
InterfaceFile * getParent() const
Returns the pointer to parent document if exists or nullptr otherwise.
Definition: InterfaceFile.h:339