llvm::MachO::RecordsSlice::addGlobal(Name,
Linkage, GV, Flags, Inlined);
26 auto Result= FrontendRecords.insert(
28 return{GR, &(
Result.first->second)};
31std::pair<ObjCInterfaceRecord *, FrontendAttrs *>
37ObjCIFSymbolKind::Class | ObjCIFSymbolKind::MetaClass;
39SymType |= ObjCIFSymbolKind::EHType;
42llvm::MachO::RecordsSlice::addObjCInterface(Name,
Linkage, SymType);
43 auto Result= FrontendRecords.insert(
45 return{ObjCR, &(
Result.first->second)};
48std::pair<ObjCCategoryRecord *, FrontendAttrs *>
50StringRef CategoryName,
54llvm::MachO::RecordsSlice::addObjCCategory(ClassToExtend, CategoryName);
55 auto Result= FrontendRecords.insert(
57 return{ObjCR, &(
Result.first->second)};
66 if((
Linkage== RecordLinkage::Exported) &&
68 Linkage= RecordLinkage::Internal;
70llvm::MachO::RecordsSlice::addObjCIVar(Container, IvarName,
Linkage);
71 auto Result= FrontendRecords.insert(
74 return{ObjCR, &(
Result.first->second)};
77std::optional<HeaderType>
85 autoIt = KnownFiles.find(FE);
86 if(It != KnownFiles.end()) {
97 autoBackupIt = KnownIncludes.find(IncludeName);
98 if(BackupIt != KnownIncludes.end()) {
99KnownFiles[FE] = BackupIt->second;
100 returnBackupIt->second;
113KnownFiles[*FE] = H.
getType();
124llvm_unreachable(
"Unexpected language option.");
138 "unexpected access level for parsing");
140raw_svector_ostream OS(Contents);
141 for(
const HeaderFile&H : Ctx.InputHeaders) {
153OS <<
"\""<< H.
getPath() <<
"\"\n";
155Ctx.addKnownHeader(H);
157 if(Contents.empty())
161{
"installapi-includes-", Ctx.Slice->getTriple().str(),
"-",
163 returnllvm::MemoryBuffer::getMemBufferCopy(Contents, BufferName);
171[&](
constStringRef FullPath) -> std::optional<std::string> {
174replace_extension(TextAPIFilePath,
".tbd");
177 returnstd::string(TextAPIFilePath);
180 returnstd::string(FullPath);
185 constStringRef
Filename= sys::path::filename(InstallName);
186 const boolIsFramework = sys::path::parent_path(InstallName)
187.ends_with((
Filename+
".framework").str());
189 for(
constStringRef
Path: FrameworkSearchPaths) {
191sys::path::append(FullPath,
Filename+ StringRef(
".framework"),
Filename);
192 if(
autoLibOrNull = getLibrary(FullPath))
198 boolIsEmbeddedDylib = (sys::path::extension(InstallName) ==
".dylib") &&
199InstallName.contains(
".framework/");
200 if(!IsEmbeddedDylib) {
201 for(
constStringRef
Path: LibrarySearchPaths) {
203sys::path::append(FullPath,
Filename);
204 if(
autoLibOrNull = getLibrary(FullPath))
210 for(
constStringRef
Path: SearchPaths) {
212sys::path::append(FullPath, InstallName);
213 if(
autoLibOrNull = getLibrary(FullPath))
llvm::MachO::ObjCIVarRecord ObjCIVarRecord
llvm::MachO::SymbolFlags SymbolFlags
llvm::MachO::ObjCCategoryRecord ObjCCategoryRecord
llvm::MachO::GlobalRecord GlobalRecord
llvm::MachO::ObjCInterfaceRecord ObjCInterfaceRecord
llvm::MachO::ObjCIFSymbolKind ObjCIFSymbolKind
llvm::MachO::RecordLinkage RecordLinkage
llvm::MachO::ObjCContainerRecord ObjCContainerRecord
Decl - This represents one declaration (or definition), e.g.
Cached information about one file (either on disk or in the virtual file system).
Implements support for file system lookup, file system caching, and directory search management.
OptionalFileEntryRef getOptionalFileRef(StringRef Filename, bool OpenFile=false, bool CacheFailure=true)
Get a FileEntryRef if it exists, without doing anything on error.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
HeaderSearch & getHeaderSearchInfo() const
std::pair< ObjCIVarRecord *, FrontendAttrs * > addObjCIVar(ObjCContainerRecord *Container, StringRef IvarName, RecordLinkage Linkage, const clang::AvailabilityInfo Avail, const Decl *D, HeaderType Access, const clang::ObjCIvarDecl::AccessControl AC)
Add ObjC IVar record with attributes from AST.
std::pair< GlobalRecord *, FrontendAttrs * > addGlobal(StringRef Name, RecordLinkage Linkage, GlobalRecord::Kind GV, const clang::AvailabilityInfo Avail, const Decl *D, const HeaderType Access, SymbolFlags Flags=SymbolFlags::None, bool Inlined=false)
Add non-ObjC global record with attributes from AST.
std::pair< ObjCInterfaceRecord *, FrontendAttrs * > addObjCInterface(StringRef Name, RecordLinkage Linkage, const clang::AvailabilityInfo Avail, const Decl *D, HeaderType Access, bool IsEHType)
Add ObjC Class record with attributes from AST.
std::pair< ObjCCategoryRecord *, FrontendAttrs * > addObjCCategory(StringRef ClassToExtend, StringRef CategoryName, const clang::AvailabilityInfo Avail, const Decl *D, HeaderType Access)
Add ObjC Category record with attributes from AST.
The DirectoryScanner for collecting library files on the file system.
@ Unknown
Unset or unknown type.
std::unique_ptr< llvm::MemoryBuffer > createInputBuffer(InstallAPIContext &Ctx)
Create a buffer that contains all headers to scan for global symbols with.
StringRef getName(const HeaderType T)
static StringRef getFileExtension(clang::Language Lang)
std::string findLibrary(StringRef InstallName, FileManager &FM, ArrayRef< std::string > FrameworkSearchPaths, ArrayRef< std::string > LibrarySearchPaths, ArrayRef< std::string > SearchPaths)
Lookup the dylib or TextAPI file location for a system library or framework.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
Language
The language for the input, used to select and validate the language standard and possible actions.
@ C
Languages that the frontend can parse and compile.
@ Result
The result type of a method or function.
Diagnostic wrappers for TextAPI types for error reporting.
Storage of availability attributes for a declaration.
Frontend information captured about records.
Struct used for generating validating InstallAPI.
std::optional< HeaderType > findAndRecordFile(const FileEntry *FE, const Preprocessor &PP)
Record visited files during frontend actions to determine whether to include their declarations for T...
void addKnownHeader(const HeaderFile &H)
Populate entries of headers that should be included for TextAPI generation.
FileManager * FM
FileManager for all I/O operations.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4