9#ifndef LLVM_CLANG_INSTALLAPI_DYLIBVERIFIER_H
10#define LLVM_CLANG_INSTALLAPI_DYLIBVERIFIER_H
36 using Entry = std::pair<std::string, ArchitectureSet>;
42 std::optional<Entry>
find(StringRef
Attr)
const;
106 : Dylib(
std::move(Dylib)), Reexports(
std::move(Reexports)),
107 Aliases(
std::move(Aliases)), Mode(Mode), Zippered(Zippered),
108 Demangle(Demangle), DSYMPath(DSYMPath),
114 const StringRef SuperClass);
148 bool shouldIgnoreObsolete(
const Record *R, SymbolContext &SymCtx,
153 bool shouldIgnoreReexport(
const Record *R, SymbolContext &SymCtx)
const;
156 bool shouldIgnoreZipperedAvailability(
const Record *R, SymbolContext &SymCtx);
161 bool shouldIgnoreInternalZipperedSymbol(
const Record *R,
162 const SymbolContext &SymCtx)
const;
166 Result compareVisibility(
const Record *R, SymbolContext &SymCtx,
171 bool compareObjCInterfaceSymbols(
const Record *R, SymbolContext &SymCtx,
175 Result compareAvailability(
const Record *R, SymbolContext &SymCtx,
179 bool compareSymbolFlags(
const Record *R, SymbolContext &SymCtx,
183 void updateState(
Result State);
186 void addSymbol(
const Record *R, SymbolContext &SymCtx,
190 void assignSlice(
const Target &
T);
193 void visitSymbolInDylib(
const Record &R, SymbolContext &SymCtx);
198 void visitObjCIVar(
const ObjCIVarRecord &R,
const StringRef Super);
201 std::string getAnnotatedName(
const Record *R, SymbolContext &SymCtx,
202 bool ValidSourceLoc =
true);
208 void accumulateSrcLocForDylibSymbols();
211 llvm::MachO::Records Dylib;
223 bool Zippered =
false;
226 bool Demangle =
false;
232 std::unique_ptr<SymbolSet> Exports = std::make_unique<SymbolSet>();
236 llvm::StringMap<ZipperedDeclSources> DeferredZipperedSymbols;
242 DWARFContext *DWARFCtx =
nullptr;
Defines the Diagnostic-related interfaces.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
llvm::MachO::ObjCIVarRecord ObjCIVarRecord
llvm::MachO::RecordLoc RecordLoc
llvm::MachO::ObjCCategoryRecord ObjCCategoryRecord
llvm::MachO::GlobalRecord GlobalRecord
llvm::MachO::AliasMap AliasMap
llvm::MachO::RecordsSlice RecordsSlice
llvm::MachO::ArchitectureSet ArchitectureSet
llvm::MachO::SymbolSet SymbolSet
llvm::MachO::ObjCInterfaceRecord ObjCInterfaceRecord
llvm::MachO::FileType FileType
llvm::MachO::Target Target
llvm::MachO::RecordsSlice::BinaryAttrs BinaryAttrs
llvm::MachO::Record Record
llvm::MachO::TargetList TargetList
Defines the SourceManager interface.
Attr - This represents one attribute.
Concrete class used by the front-end to report problems and issues.
This class handles loading and caching of source files into memory.
Service responsible to tracking state of verification across the lifetime of InstallAPI.
Result verify(GlobalRecord *R, const FrontendAttrs *FA)
Result getState() const
Get result of verification.
void setSourceManager(IntrusiveRefCntPtr< SourceManager > SourceMgr)
Set different source managers to the same diagnostics engine.
std::unique_ptr< SymbolSet > takeExports()
Release ownership over exports.
bool verifyBinaryAttrs(const ArrayRef< Target > ProvidedTargets, const BinaryAttrs &ProvidedBA, const LibAttrs &ProvidedReexports, const LibAttrs &ProvidedClients, const LibAttrs &ProvidedRPaths, const FileType &FT)
Compare and report the attributes represented as load commands in the dylib to the attributes provide...
void setTarget(const Target &T)
Initialize target for verification.
DylibVerifier(llvm::MachO::Records &&Dylib, ReexportedInterfaces &&Reexports, AliasMap Aliases, DiagnosticsEngine *Diag, VerificationMode Mode, bool Zippered, bool Demangle, StringRef DSYMPath)
Result verifyRemainingSymbols()
Represents dynamic library specific attributes that are tied to architecture slices.
std::pair< std::string, ArchitectureSet > Entry
std::optional< Entry > find(StringRef Attr) const
const AttrsToArchs & get() const
ArchitectureSet & getArchSet(StringRef Attr)
llvm::SmallVector< Entry, 10 > AttrsToArchs
bool operator==(const LibAttrs &Other) const
std::vector< ZipperedDeclSource > ZipperedDeclSources
VerificationMode
A list of InstallAPI verification modes.
llvm::SmallVector< llvm::MachO::InterfaceFile, 8 > ReexportedInterfaces
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
@ Other
Other implicit parameter.
Metadata stored about a mapping of a declaration to a symbol.
bool DiscoveredFirstError
VerifierContext(DiagnosticsEngine *Diag)
VerifierContext()=default
void emitDiag(llvm::function_ref< void()> Report, RecordLoc *Loc=nullptr)
RecordsSlice * DylibSlice
llvm::MachO::Target Target
Frontend information captured about records.
clang::SourceManager * SrcMgr