Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.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/Hashing.h"
18#include "llvm/ADT/StringRef.h"
19#include "llvm/ADT/iterator.h"
20#include "llvm/Support/Allocator.h"
21#include "llvm/TextAPI/ArchitectureSet.h"
22#include "llvm/TextAPI/FileTypes.h"
23#include "llvm/TextAPI/PackedVersion.h"
24#include "llvm/TextAPI/Platform.h"
25#include "llvm/TextAPI/RecordsSlice.h"
26#include "llvm/TextAPI/Symbol.h"
27#include "llvm/TextAPI/SymbolSet.h"
28#include "llvm/TextAPI/Target.h"
29
30namespacellvm {
31namespaceMachO {
32
33/// Defines a list of Objective-C constraints.
34enum classObjCConstraintType :unsigned {
35 /// No constraint.
36None = 0,
37
38 /// Retain/Release.
39Retain_Release = 1,
40
41 /// Retain/Release for Simulator.
42Retain_Release_For_Simulator = 2,
43
44 /// Retain/Release or Garbage Collection.
45Retain_Release_Or_GC = 3,
46
47 /// Garbage Collection.
48GC = 4,
49};
50
51/// Reference to an interface file.
52classInterfaceFileRef {
53public:
54InterfaceFileRef() =default;
55
56InterfaceFileRef(StringRef InstallName) : InstallName(InstallName) {}
57
58InterfaceFileRef(StringRef InstallName,constTargetList Targets)
59 : InstallName(InstallName), Targets(std::move(Targets)) {}
60
61StringRefgetInstallName() const{return InstallName; };
62
63voidaddTarget(constTarget &Target);
64template <typename RangeT>voidaddTargets(RangeT &&Targets) {
65for (constauto &Target : Targets)
66addTarget(Target(Target));
67 }
68
69boolhasTarget(Target &Targ) const{
70returnllvm::is_contained(Targets, Targ);
71 }
72
73usingconst_target_iterator =TargetList::const_iterator;
74usingconst_target_range =llvm::iterator_range<const_target_iterator>;
75const_target_rangetargets() const{return {Targets}; }
76
77ArchitectureSetgetArchitectures() const{
78returnmapToArchitectureSet(Targets);
79 }
80
81PlatformSetgetPlatforms() const{returnmapToPlatformSet(Targets); }
82
83booloperator==(constInterfaceFileRef &O) const{
84return std::tie(InstallName, Targets) == std::tie(O.InstallName, O.Targets);
85 }
86
87booloperator!=(constInterfaceFileRef &O) const{
88return std::tie(InstallName, Targets) != std::tie(O.InstallName, O.Targets);
89 }
90
91booloperator<(constInterfaceFileRef &O) const{
92return std::tie(InstallName, Targets) < std::tie(O.InstallName, O.Targets);
93 }
94
95private:
96 std::string InstallName;
97TargetList Targets;
98};
99
100}// end namespace MachO.
101
102namespaceMachO {
103
104/// Defines the interface file.
105classInterfaceFile {
106public:
107InterfaceFile(std::unique_ptr<SymbolSet> &&InputSymbols)
108 : SymbolsSet(std::move(InputSymbols)) {}
109
110InterfaceFile() : SymbolsSet(std::make_unique<SymbolSet>()){};
111 /// Set the path from which this file was generated (if applicable).
112 ///
113 /// \param Path_ The path to the source file.
114voidsetPath(StringRef Path_) { Path = std::string(Path_); }
115
116 /// Get the path from which this file was generated (if applicable).
117 ///
118 /// \return The path to the source file or empty.
119StringRefgetPath() const{return Path; }
120
121 /// Set the file type.
122 ///
123 /// This is used by the YAML writer to identify the specification it should
124 /// use for writing the file.
125 ///
126 /// \param Kind The file type.
127voidsetFileType(FileType Kind) { FileKind = Kind; }
128
129 /// Get the file type.
130 ///
131 /// \return The file type.
132FileTypegetFileType() const{return FileKind; }
133
134 /// Get the architectures.
135 ///
136 /// \return The applicable architectures.
137ArchitectureSetgetArchitectures() const{
138returnmapToArchitectureSet(Targets);
139 }
140
141 /// Get the platforms.
142 ///
143 /// \return The applicable platforms.
144PlatformSetgetPlatforms() const{returnmapToPlatformSet(Targets); }
145
146 /// Set and add target.
147 ///
148 /// \param Target the target to add into.
149voidaddTarget(constTarget &Target);
150
151 /// Determine if target triple slice exists in file.
152 ///
153 /// \param Targ the value to find.
154boolhasTarget(constTarget &Targ) const{
155returnllvm::is_contained(Targets, Targ);
156 }
157
158 /// Set and add targets.
159 ///
160 /// Add the subset of llvm::triples that is supported by Tapi
161 ///
162 /// \param Targets the collection of targets.
163template <typename RangeT>voidaddTargets(RangeT &&Targets) {
164for (constauto &Target_ : Targets)
165addTarget(Target(Target_));
166 }
167
168usingconst_target_iterator =TargetList::const_iterator;
169usingconst_target_range =llvm::iterator_range<const_target_iterator>;
170const_target_rangetargets() const{return {Targets}; }
171
172usingconst_filtered_target_iterator =
173llvm::filter_iterator<const_target_iterator,
174 std::function<bool(constTarget &)>>;
175usingconst_filtered_target_range =
176llvm::iterator_range<const_filtered_target_iterator>;
177const_filtered_target_rangetargets(ArchitectureSet Archs)const;
178
179 /// Set the install name of the library.
180voidsetInstallName(StringRef InstallName_) {
181 InstallName = std::string(InstallName_);
182 }
183
184 /// Get the install name of the library.
185StringRefgetInstallName() const{return InstallName; }
186
187 /// Set the current version of the library.
188voidsetCurrentVersion(PackedVersionVersion) { CurrentVersion =Version; }
189
190 /// Get the current version of the library.
191PackedVersiongetCurrentVersion() const{return CurrentVersion; }
192
193 /// Set the compatibility version of the library.
194voidsetCompatibilityVersion(PackedVersionVersion) {
195 CompatibilityVersion =Version;
196 }
197
198 /// Get the compatibility version of the library.
199PackedVersiongetCompatibilityVersion() const{return CompatibilityVersion; }
200
201 /// Set the Swift ABI version of the library.
202voidsetSwiftABIVersion(uint8_tVersion) { SwiftABIVersion =Version; }
203
204 /// Get the Swift ABI version of the library.
205uint8_tgetSwiftABIVersion() const{return SwiftABIVersion; }
206
207 /// Specify if the library uses two-level namespace (or flat namespace).
208voidsetTwoLevelNamespace(bool V =true) { IsTwoLevelNamespace = V; }
209
210 /// Check if the library uses two-level namespace.
211boolisTwoLevelNamespace() const{return IsTwoLevelNamespace; }
212
213 /// Specify if the library is an OS library but not shared cache eligible.
214voidsetOSLibNotForSharedCache(bool V =true) {
215 IsOSLibNotForSharedCache = V;
216 }
217
218 /// Check if the library is an OS library that is not shared cache eligible.
219boolisOSLibNotForSharedCache() const{return IsOSLibNotForSharedCache; }
220
221 /// Specify if the library is application extension safe (or not).
222voidsetApplicationExtensionSafe(bool V =true) { IsAppExtensionSafe = V; }
223
224 /// Check if the library is application extension safe.
225boolisApplicationExtensionSafe() const{return IsAppExtensionSafe; }
226
227 /// Check if the library has simulator support.
228boolhasSimulatorSupport() const{return HasSimSupport; }
229
230 /// Specify if the library has simulator support.
231voidsetSimulatorSupport(bool V =true) { HasSimSupport = V; }
232
233 /// Set the Objective-C constraint.
234voidsetObjCConstraint(ObjCConstraintType Constraint) {
235 ObjcConstraint = Constraint;
236 }
237
238 /// Get the Objective-C constraint.
239ObjCConstraintTypegetObjCConstraint() const{return ObjcConstraint; }
240
241 /// Set the parent umbrella frameworks.
242 /// \param Target_ The target applicable to Parent
243 /// \param Parent The name of Parent
244voidaddParentUmbrella(constTarget &Target_,StringRef Parent);
245
246 /// Get the list of Parent Umbrella frameworks.
247 ///
248 /// \return Returns a list of target information and install name of parent
249 /// umbrellas.
250const std::vector<std::pair<Target, std::string>> &umbrellas() const{
251return ParentUmbrellas;
252 }
253
254 /// Add an allowable client.
255 ///
256 /// Mach-O Dynamic libraries have the concept of allowable clients that are
257 /// checked during static link time. The name of the application or library
258 /// that is being generated needs to match one of the allowable clients or the
259 /// linker refuses to link this library.
260 ///
261 /// \param InstallName The name of the client that is allowed to link this
262 /// library.
263 /// \param Target The target triple for which this applies.
264voidaddAllowableClient(StringRef InstallName,constTarget &Target);
265
266 /// Get the list of allowable clients.
267 ///
268 /// \return Returns a list of allowable clients.
269const std::vector<InterfaceFileRef> &allowableClients() const{
270return AllowableClients;
271 }
272
273 /// Add a re-exported library.
274 ///
275 /// \param InstallName The name of the library to re-export.
276 /// \param Target The target triple for which this applies.
277voidaddReexportedLibrary(StringRef InstallName,constTarget &Target);
278
279 /// Get the list of re-exported libraries.
280 ///
281 /// \return Returns a list of re-exported libraries.
282const std::vector<InterfaceFileRef> &reexportedLibraries() const{
283return ReexportedLibraries;
284 }
285
286 /// Add a library for inlining to top level library.
287 ///
288 ///\param Document The library to inline with top level library.
289voidaddDocument(std::shared_ptr<InterfaceFile> &&Document);
290
291 /// Returns the pointer to parent document if exists or nullptr otherwise.
292InterfaceFile *getParent() const{return Parent; }
293
294 /// Get the list of inlined libraries.
295 ///
296 /// \return Returns a list of the inlined frameworks.
297const std::vector<std::shared_ptr<InterfaceFile>> &documents() const{
298return Documents;
299 }
300
301 /// Set the runpath search paths.
302 /// \param RPath The name of runpath.
303 /// \param InputTarget The target applicable to runpath search path.
304voidaddRPath(StringRef RPath,constTarget &InputTarget);
305
306 /// Get the list of runpath search paths.
307 ///
308 /// \return Returns a list of the rpaths per target.
309const std::vector<std::pair<Target, std::string>> &rpaths() const{
310return RPaths;
311 }
312
313 /// Get symbol if exists in file.
314 ///
315 /// \param Kind The kind of global symbol to record.
316 /// \param Name The name of the symbol.
317 /// \param ObjCIF The ObjCInterface symbol type, if applicable.
318 std::optional<const Symbol *>
319getSymbol(EncodeKind Kind,StringRefName,
320ObjCIFSymbolKind ObjCIF =ObjCIFSymbolKind::None) const{
321if (auto *Sym = SymbolsSet->findSymbol(Kind,Name, ObjCIF))
322returnSym;
323return std::nullopt;
324 }
325
326 /// Add a symbol to the symbols list or extend an existing one.
327template <typename RangeT,typename ElT = std::remove_reference_t<
328decltype(*std::begin(std::declval<RangeT>()))>>
329voidaddSymbol(EncodeKind Kind,StringRefName, RangeT &&Targets,
330SymbolFlags Flags =SymbolFlags::None) {
331 SymbolsSet->addGlobal(Kind,Name, Flags, Targets);
332 }
333
334 /// Add Symbol with multiple targets.
335 ///
336 /// \param Kind The kind of global symbol to record.
337 /// \param Name The name of the symbol.
338 /// \param Targets The list of targets the symbol is defined in.
339 /// \param Flags The properties the symbol holds.
340voidaddSymbol(EncodeKind Kind,StringRefName,TargetList &&Targets,
341SymbolFlags Flags =SymbolFlags::None) {
342 SymbolsSet->addGlobal(Kind,Name, Flags, Targets);
343 }
344
345 /// Add Symbol with single target.
346 ///
347 /// \param Kind The kind of global symbol to record.
348 /// \param Name The name of the symbol.
349 /// \param Target The target the symbol is defined in.
350 /// \param Flags The properties the symbol holds.
351voidaddSymbol(EncodeKind Kind,StringRefName,Target &Target,
352SymbolFlags Flags =SymbolFlags::None) {
353 SymbolsSet->addGlobal(Kind,Name, Flags,Target);
354 }
355
356 /// Get size of symbol set.
357 /// \return The number of symbols the file holds.
358size_tsymbolsCount() const{return SymbolsSet->size(); }
359
360usingconst_symbol_range =SymbolSet::const_symbol_range;
361usingconst_filtered_symbol_range =SymbolSet::const_filtered_symbol_range;
362
363const_symbol_rangesymbols() const{return SymbolsSet->symbols(); };
364const_filtered_symbol_rangeexports() const{return SymbolsSet->exports(); };
365const_filtered_symbol_rangereexports() const{
366return SymbolsSet->reexports();
367 };
368const_filtered_symbol_rangeundefineds() const{
369return SymbolsSet->undefineds();
370 };
371
372 /// Extract architecture slice from Interface.
373 ///
374 /// \param Arch architecture to extract from.
375 /// \return New InterfaceFile with extracted architecture slice.
376llvm::Expected<std::unique_ptr<InterfaceFile>>
377extract(Architecture Arch)const;
378
379 /// Remove architecture slice from Interface.
380 ///
381 /// \param Arch architecture to remove.
382 /// \return New Interface File with removed architecture slice.
383llvm::Expected<std::unique_ptr<InterfaceFile>>
384remove(Architecture Arch)const;
385
386 /// Merge Interfaces for the same library. The following library attributes
387 /// must match.
388 /// * Install name, Current & Compatibility version,
389 /// * Two-level namespace enablement, and App extension enablement.
390 ///
391 /// \param O The Interface to merge.
392 /// \return New Interface File that was merged.
393llvm::Expected<std::unique_ptr<InterfaceFile>>
394merge(constInterfaceFile *O)const;
395
396 /// Inline reexported library into Interface.
397 ///
398 /// \param Library Interface of reexported library.
399 /// \param Overwrite Whether to overwrite preexisting inlined library.
400voidinlineLibrary(std::shared_ptr<InterfaceFile> Library,
401bool Overwrite =false);
402
403 /// Set InterfaceFile properties from pre-gathered binary attributes,
404 /// if they are not set already.
405 ///
406 /// \param BA Attributes typically represented in load commands.
407 /// \param Targ MachO Target slice to add attributes to.
408voidsetFromBinaryAttrs(constRecordsSlice::BinaryAttrs &BA,
409constTarget &Targ);
410
411 /// The equality is determined by attributes that impact linking
412 /// compatibilities. Path, & FileKind are irrelevant since these by
413 /// itself should not impact linking.
414 /// This is an expensive operation.
415bool operator==(constInterfaceFile &O)const;
416
417booloperator!=(constInterfaceFile &O) const{return !(*this == O); }
418
419private:
420llvm::BumpPtrAllocator Allocator;
421StringRef copyString(StringRefString) {
422if (String.empty())
423return {};
424
425void *Ptr =Allocator.Allocate(String.size(), 1);
426 memcpy(Ptr,String.data(),String.size());
427returnStringRef(reinterpret_cast<constchar *>(Ptr),String.size());
428 }
429
430TargetList Targets;
431 std::string Path;
432FileType FileKind{FileType::Invalid};
433 std::string InstallName;
434 PackedVersion CurrentVersion;
435 PackedVersion CompatibilityVersion;
436uint8_t SwiftABIVersion{0};
437bool IsTwoLevelNamespace{false};
438bool IsOSLibNotForSharedCache{false};
439bool IsAppExtensionSafe{false};
440bool HasSimSupport{false};
441ObjCConstraintType ObjcConstraint =ObjCConstraintType::None;
442 std::vector<std::pair<Target, std::string>> ParentUmbrellas;
443 std::vector<InterfaceFileRef> AllowableClients;
444 std::vector<InterfaceFileRef> ReexportedLibraries;
445 std::vector<std::shared_ptr<InterfaceFile>> Documents;
446 std::vector<std::pair<Target, std::string>> RPaths;
447 std::unique_ptr<SymbolSet> SymbolsSet;
448InterfaceFile *Parent =nullptr;
449};
450
451// Keep containers that hold InterfaceFileRefs in sorted order and uniqued.
452template <typename C>
453typename C::iteratoraddEntry(C &Container,StringRef InstallName) {
454autoI =partition_point(Container, [=](constInterfaceFileRef &O) {
455return O.getInstallName() < InstallName;
456 });
457if (I != Container.end() &&I->getInstallName() == InstallName)
458returnI;
459
460return Container.emplace(I, InstallName);
461}
462
463}// end namespace MachO.
464}// end namespace llvm.
465
466#endif// LLVM_TEXTAPI_INTERFACEFILE_H
Allocator.h
This file defines the BumpPtrAllocator interface.
ArchitectureSet.h
Name
std::string Name
Definition:ELFObjHandler.cpp:77
Sym
Symbol * Sym
Definition:ELF_riscv.cpp:479
FileTypes.h
Hashing.h
extract
loop extract
Definition:LoopExtractor.cpp:92
I
#define I(x, y, z)
Definition:MD5.cpp:58
PackedVersion.h
Platform.h
RecordsSlice.h
Implements the TAPI Record Collection Type.
Allocator
Basic Register Allocator
Definition:RegAllocBasic.cpp:146
StringRef.h
SymbolSet.h
Symbol.h
Ptr
@ Ptr
Definition:TargetLibraryInfo.cpp:77
T
bool
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition:Allocator.h:66
llvm::Expected
Tagged union holding either a T or a Error.
Definition:Error.h:481
llvm::MachO::ArchitectureSet
Definition:ArchitectureSet.h:29
llvm::MachO::InterfaceFileRef
Reference to an interface file.
Definition:InterfaceFile.h:52
llvm::MachO::InterfaceFileRef::InterfaceFileRef
InterfaceFileRef(StringRef InstallName, const TargetList Targets)
Definition:InterfaceFile.h:58
llvm::MachO::InterfaceFileRef::hasTarget
bool hasTarget(Target &Targ) const
Definition:InterfaceFile.h:69
llvm::MachO::InterfaceFileRef::operator!=
bool operator!=(const InterfaceFileRef &O) const
Definition:InterfaceFile.h:87
llvm::MachO::InterfaceFileRef::addTargets
void addTargets(RangeT &&Targets)
Definition:InterfaceFile.h:64
llvm::MachO::InterfaceFileRef::getPlatforms
PlatformSet getPlatforms() const
Definition:InterfaceFile.h:81
llvm::MachO::InterfaceFileRef::addTarget
void addTarget(const Target &Target)
Definition:InterfaceFile.cpp:22
llvm::MachO::InterfaceFileRef::targets
const_target_range targets() const
Definition:InterfaceFile.h:75
llvm::MachO::InterfaceFileRef::getInstallName
StringRef getInstallName() const
Definition:InterfaceFile.h:61
llvm::MachO::InterfaceFileRef::operator==
bool operator==(const InterfaceFileRef &O) const
Definition:InterfaceFile.h:83
llvm::MachO::InterfaceFileRef::getArchitectures
ArchitectureSet getArchitectures() const
Definition:InterfaceFile.h:77
llvm::MachO::InterfaceFileRef::InterfaceFileRef
InterfaceFileRef(StringRef InstallName)
Definition:InterfaceFile.h:56
llvm::MachO::InterfaceFileRef::InterfaceFileRef
InterfaceFileRef()=default
llvm::MachO::InterfaceFileRef::operator<
bool operator<(const InterfaceFileRef &O) const
Definition:InterfaceFile.h:91
llvm::MachO::InterfaceFile
Defines the interface file.
Definition:InterfaceFile.h:105
llvm::MachO::InterfaceFile::getSymbol
std::optional< const Symbol * > getSymbol(EncodeKind Kind, StringRef Name, ObjCIFSymbolKind ObjCIF=ObjCIFSymbolKind::None) const
Get symbol if exists in file.
Definition:InterfaceFile.h:319
llvm::MachO::InterfaceFile::addDocument
void addDocument(std::shared_ptr< InterfaceFile > &&Document)
Add a library for inlining to top level library.
Definition:InterfaceFile.cpp:84
llvm::MachO::InterfaceFile::InterfaceFile
InterfaceFile()
Definition:InterfaceFile.h:110
llvm::MachO::InterfaceFile::getPath
StringRef getPath() const
Get the path from which this file was generated (if applicable).
Definition:InterfaceFile.h:119
llvm::MachO::InterfaceFile::addReexportedLibrary
void addReexportedLibrary(StringRef InstallName, const Target &Target)
Add a re-exported library.
Definition:InterfaceFile.cpp:34
llvm::MachO::InterfaceFile::setPath
void setPath(StringRef Path_)
Set the path from which this file was generated (if applicable).
Definition:InterfaceFile.h:114
llvm::MachO::InterfaceFile::setFromBinaryAttrs
void setFromBinaryAttrs(const RecordsSlice::BinaryAttrs &BA, const Target &Targ)
Set InterfaceFile properties from pre-gathered binary attributes, if they are not set already.
Definition:InterfaceFile.cpp:363
llvm::MachO::InterfaceFile::addParentUmbrella
void addParentUmbrella(const Target &Target_, StringRef Parent)
Set the parent umbrella frameworks.
Definition:InterfaceFile.cpp:42
llvm::MachO::InterfaceFile::targets
const_target_range targets() const
Definition:InterfaceFile.h:170
llvm::MachO::InterfaceFile::setOSLibNotForSharedCache
void setOSLibNotForSharedCache(bool V=true)
Specify if the library is an OS library but not shared cache eligible.
Definition:InterfaceFile.h:214
llvm::MachO::InterfaceFile::isOSLibNotForSharedCache
bool isOSLibNotForSharedCache() const
Check if the library is an OS library that is not shared cache eligible.
Definition:InterfaceFile.h:219
llvm::MachO::InterfaceFile::reexports
const_filtered_symbol_range reexports() const
Definition:InterfaceFile.h:365
llvm::MachO::InterfaceFile::remove
llvm::Expected< std::unique_ptr< InterfaceFile > > remove(Architecture Arch) const
Remove architecture slice from Interface.
Definition:InterfaceFile.cpp:223
llvm::MachO::InterfaceFile::setObjCConstraint
void setObjCConstraint(ObjCConstraintType Constraint)
Set the Objective-C constraint.
Definition:InterfaceFile.h:234
llvm::MachO::InterfaceFile::isTwoLevelNamespace
bool isTwoLevelNamespace() const
Check if the library uses two-level namespace.
Definition:InterfaceFile.h:211
llvm::MachO::InterfaceFile::getCompatibilityVersion
PackedVersion getCompatibilityVersion() const
Get the compatibility version of the library.
Definition:InterfaceFile.h:199
llvm::MachO::InterfaceFile::symbolsCount
size_t symbolsCount() const
Get size of symbol set.
Definition:InterfaceFile.h:358
llvm::MachO::InterfaceFile::operator!=
bool operator!=(const InterfaceFile &O) const
Definition:InterfaceFile.h:417
llvm::MachO::InterfaceFile::addTarget
void addTarget(const Target &Target)
Set and add target.
Definition:InterfaceFile.cpp:72
llvm::MachO::InterfaceFile::exports
const_filtered_symbol_range exports() const
Definition:InterfaceFile.h:364
llvm::MachO::InterfaceFile::isApplicationExtensionSafe
bool isApplicationExtensionSafe() const
Check if the library is application extension safe.
Definition:InterfaceFile.h:225
llvm::MachO::InterfaceFile::addSymbol
void addSymbol(EncodeKind Kind, StringRef Name, TargetList &&Targets, SymbolFlags Flags=SymbolFlags::None)
Add Symbol with multiple targets.
Definition:InterfaceFile.h:340
llvm::MachO::InterfaceFile::setSimulatorSupport
void setSimulatorSupport(bool V=true)
Specify if the library has simulator support.
Definition:InterfaceFile.h:231
llvm::MachO::InterfaceFile::getPlatforms
PlatformSet getPlatforms() const
Get the platforms.
Definition:InterfaceFile.h:144
llvm::MachO::InterfaceFile::rpaths
const std::vector< std::pair< Target, std::string > > & rpaths() const
Get the list of runpath search paths.
Definition:InterfaceFile.h:309
llvm::MachO::InterfaceFile::allowableClients
const std::vector< InterfaceFileRef > & allowableClients() const
Get the list of allowable clients.
Definition:InterfaceFile.h:269
llvm::MachO::InterfaceFile::addSymbol
void addSymbol(EncodeKind Kind, StringRef Name, RangeT &&Targets, SymbolFlags Flags=SymbolFlags::None)
Add a symbol to the symbols list or extend an existing one.
Definition:InterfaceFile.h:329
llvm::MachO::InterfaceFile::setInstallName
void setInstallName(StringRef InstallName_)
Set the install name of the library.
Definition:InterfaceFile.h:180
llvm::MachO::InterfaceFile::addTargets
void addTargets(RangeT &&Targets)
Set and add targets.
Definition:InterfaceFile.h:163
llvm::MachO::InterfaceFile::documents
const std::vector< std::shared_ptr< InterfaceFile > > & documents() const
Get the list of inlined libraries.
Definition:InterfaceFile.h:297
llvm::MachO::InterfaceFile::umbrellas
const std::vector< std::pair< Target, std::string > > & umbrellas() const
Get the list of Parent Umbrella frameworks.
Definition:InterfaceFile.h:250
llvm::MachO::InterfaceFile::InterfaceFile
InterfaceFile(std::unique_ptr< SymbolSet > &&InputSymbols)
Definition:InterfaceFile.h:107
llvm::MachO::InterfaceFile::reexportedLibraries
const std::vector< InterfaceFileRef > & reexportedLibraries() const
Get the list of re-exported libraries.
Definition:InterfaceFile.h:282
llvm::MachO::InterfaceFile::getParent
InterfaceFile * getParent() const
Returns the pointer to parent document if exists or nullptr otherwise.
Definition:InterfaceFile.h:292
llvm::MachO::InterfaceFile::symbols
const_symbol_range symbols() const
Definition:InterfaceFile.h:363
llvm::MachO::InterfaceFile::setFileType
void setFileType(FileType Kind)
Set the file type.
Definition:InterfaceFile.h:127
llvm::MachO::InterfaceFile::getSwiftABIVersion
uint8_t getSwiftABIVersion() const
Get the Swift ABI version of the library.
Definition:InterfaceFile.h:205
llvm::MachO::InterfaceFile::getCurrentVersion
PackedVersion getCurrentVersion() const
Get the current version of the library.
Definition:InterfaceFile.h:191
llvm::MachO::InterfaceFile::addSymbol
void addSymbol(EncodeKind Kind, StringRef Name, Target &Target, SymbolFlags Flags=SymbolFlags::None)
Add Symbol with single target.
Definition:InterfaceFile.h:351
llvm::MachO::InterfaceFile::addRPath
void addRPath(StringRef RPath, const Target &InputTarget)
Set the runpath search paths.
Definition:InterfaceFile.cpp:57
llvm::MachO::InterfaceFile::undefineds
const_filtered_symbol_range undefineds() const
Definition:InterfaceFile.h:368
llvm::MachO::InterfaceFile::setCompatibilityVersion
void setCompatibilityVersion(PackedVersion Version)
Set the compatibility version of the library.
Definition:InterfaceFile.h:194
llvm::MachO::InterfaceFile::getArchitectures
ArchitectureSet getArchitectures() const
Get the architectures.
Definition:InterfaceFile.h:137
llvm::MachO::InterfaceFile::getInstallName
StringRef getInstallName() const
Get the install name of the library.
Definition:InterfaceFile.h:185
llvm::MachO::InterfaceFile::merge
llvm::Expected< std::unique_ptr< InterfaceFile > > merge(const InterfaceFile *O) const
Merge Interfaces for the same library.
Definition:InterfaceFile.cpp:127
llvm::MachO::InterfaceFile::getObjCConstraint
ObjCConstraintType getObjCConstraint() const
Get the Objective-C constraint.
Definition:InterfaceFile.h:239
llvm::MachO::InterfaceFile::getFileType
FileType getFileType() const
Get the file type.
Definition:InterfaceFile.h:132
llvm::MachO::InterfaceFile::setApplicationExtensionSafe
void setApplicationExtensionSafe(bool V=true)
Specify if the library is application extension safe (or not).
Definition:InterfaceFile.h:222
llvm::MachO::InterfaceFile::addAllowableClient
void addAllowableClient(StringRef InstallName, const Target &Target)
Add an allowable client.
Definition:InterfaceFile.cpp:26
llvm::MachO::InterfaceFile::inlineLibrary
void inlineLibrary(std::shared_ptr< InterfaceFile > Library, bool Overwrite=false)
Inline reexported library into Interface.
Definition:InterfaceFile.cpp:97
llvm::MachO::InterfaceFile::hasTarget
bool hasTarget(const Target &Targ) const
Determine if target triple slice exists in file.
Definition:InterfaceFile.h:154
llvm::MachO::InterfaceFile::setSwiftABIVersion
void setSwiftABIVersion(uint8_t Version)
Set the Swift ABI version of the library.
Definition:InterfaceFile.h:202
llvm::MachO::InterfaceFile::setCurrentVersion
void setCurrentVersion(PackedVersion Version)
Set the current version of the library.
Definition:InterfaceFile.h:188
llvm::MachO::InterfaceFile::const_target_iterator
TargetList::const_iterator const_target_iterator
Definition:InterfaceFile.h:168
llvm::MachO::InterfaceFile::setTwoLevelNamespace
void setTwoLevelNamespace(bool V=true)
Specify if the library uses two-level namespace (or flat namespace).
Definition:InterfaceFile.h:208
llvm::MachO::InterfaceFile::hasSimulatorSupport
bool hasSimulatorSupport() const
Check if the library has simulator support.
Definition:InterfaceFile.h:228
llvm::MachO::PackedVersion
Definition:PackedVersion.h:27
llvm::MachO::SymbolSet
Definition:SymbolSet.h:76
llvm::MachO::SymbolSet::const_symbol_range
iterator_range< const_symbol_iterator > const_symbol_range
Definition:SymbolSet.h:129
llvm::MachO::SymbolSet::const_filtered_symbol_range
iterator_range< const_filtered_symbol_iterator > const_filtered_symbol_range
Definition:SymbolSet.h:135
llvm::MachO::Target
Definition:Target.h:28
llvm::SmallSet
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Definition:SmallSet.h:132
llvm::SmallVectorTemplateCommon::const_iterator
const T * const_iterator
Definition:SmallVector.h:252
llvm::SmallVector< Target, 5 >
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::filter_iterator_impl
Specialization of filter_iterator_base for forward iteration only.
Definition:STLExtras.h:498
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition:iterator_range.h:42
uint8_t
iterator.h
Target.h
llvm::CallingConv::C
@ C
The default llvm calling convention, compatible with C.
Definition:CallingConv.h:34
llvm::MachO::FileType
FileType
Defines the file type TextAPI files can represent.
Definition:FileTypes.h:15
llvm::MachO::Invalid
@ Invalid
Invalid file type.
Definition:FileTypes.h:17
llvm::MachO::addEntry
C::iterator addEntry(C &Container, StringRef InstallName)
Definition:InterfaceFile.h:453
llvm::MachO::mapToPlatformSet
PlatformSet mapToPlatformSet(ArrayRef< Triple > Targets)
Definition:Platform.cpp:62
llvm::MachO::ObjCConstraintType
ObjCConstraintType
Defines a list of Objective-C constraints.
Definition:InterfaceFile.h:34
llvm::MachO::ObjCConstraintType::None
@ None
No constraint.
llvm::MachO::ObjCConstraintType::Retain_Release_For_Simulator
@ Retain_Release_For_Simulator
Retain/Release for Simulator.
llvm::MachO::ObjCConstraintType::GC
@ GC
Garbage Collection.
llvm::MachO::ObjCConstraintType::Retain_Release_Or_GC
@ Retain_Release_Or_GC
Retain/Release or Garbage Collection.
llvm::MachO::ObjCConstraintType::Retain_Release
@ Retain_Release
Retain/Release.
llvm::MachO::Architecture
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
Definition:Architecture.h:27
llvm::MachO::TargetList
SmallVector< Target, 5 > TargetList
Definition:Symbol.h:81
llvm::MachO::ObjCIFSymbolKind
ObjCIFSymbolKind
ObjC Interface symbol mappings.
Definition:Symbol.h:69
llvm::MachO::ObjCIFSymbolKind::None
@ None
llvm::MachO::EncodeKind
EncodeKind
Mapping of entry types in TextStubs.
Definition:Symbol.h:55
llvm::MachO::SymbolFlags
SymbolFlags
Symbol flags.
Definition:Symbol.h:24
llvm::MachO::SymbolFlags::None
@ None
No flags.
llvm::MachO::mapToArchitectureSet
ArchitectureSet mapToArchitectureSet(ArrayRef< Target > Targets)
Definition:Target.cpp:69
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::partition_point
auto partition_point(R &&Range, Predicate P)
Binary search for the first iterator in a range where a predicate is false.
Definition:STLExtras.h:2050
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:1873
llvm::HighlightColor::String
@ String
llvm::is_contained
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition:STLExtras.h:1903
llvm::Version
@ Version
Definition:PGOCtxProfWriter.h:22
std
Implement std::hash so that hash_code can be used in STL containers.
Definition:BitVector.h:858
llvm::MachO::RecordsSlice::BinaryAttrs
Definition:RecordsSlice.h:143

Generated on Thu Jul 17 2025 10:23:43 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp