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