LLVM 17.0.0git
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
TextStubV5.cpp File Reference
#include "TextStubCommon.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/JSON.h"
#include <utility>

Go to the source code of this file.

Classes

struct  JSONSymbol
 
class  JSONStubError
 

Namespaces

namespace  StubParser
 

Typedefs

using AttrToTargets = std::map< std::string, TargetList >
 
using TargetsToSymbols = SmallVector< std::pair< TargetList, std::vector< JSONSymbol > > >
 
using StubParser::IFPtr = std::unique_ptr< InterfaceFile >
 

Enumerations

enum  TBDKey : size_t {
  TBDVersion = 0U , MainLibrary , Documents , TargetInfo ,
  Targets , Target , Deployment , Flags ,
  Attributes , InstallName , CurrentVersion , CompatibilityVersion ,
  Version , SwiftABI , ABI , ParentUmbrella ,
  Umbrella , AllowableClients , Clients , ReexportLibs ,
  Names , Name , Exports , Reexports ,
  Undefineds , Data , Text , Weak ,
  ThreadLocal , Globals , ObjCClass , ObjCEHType ,
  ObjCIvar , RPath , Paths
}
 

Functions

static llvm::SmallString< 128 > getParseErrorMsg (TBDKey Key)
 
static llvm::SmallString< 128 > getSerializeErrorMsg (TBDKey Key)
 
template<typename JsonT , typename StubT = JsonT>
Expected< StubT > getRequiredValue (TBDKey Key, const Object *Obj, std::function< std::optional< JsonT >(const Object *, StringRef)> GetValue, std::function< std::optional< StubT >(JsonT)> Validate=nullptr)
 
template<typename JsonT , typename StubT = JsonT>
Expected< StubT > getRequiredValue (TBDKey Key, const Object *Obj, std::function< std::optional< JsonT >(const Object *, StringRef)> GetValue, StubT DefaultValue, std::function< std::optional< StubT >(JsonT)> Validate)
 
Error collectFromArray (TBDKey Key, const Object *Obj, std::function< void(StringRef)> Append, bool IsRequired=false)
 
Expected< FileTypeStubParser::getVersion (const Object *File)
 
Expected< TargetListStubParser::getTargets (const Object *Section)
 
Expected< TargetListStubParser::getTargetsSection (const Object *Section)
 
Error StubParser::collectSymbolsFromSegment (const Object *Segment, TargetsToSymbols &Result, SymbolFlags SectionFlag)
 
Expected< StringRefStubParser::getNameSection (const Object *File)
 
Expected< TargetsToSymbolsStubParser::getSymbolSection (const Object *File, TBDKey Key, TargetList &Targets)
 
Expected< AttrToTargetsStubParser::getLibSection (const Object *File, TBDKey Key, TBDKey SubKey, const TargetList &Targets)
 
Expected< AttrToTargetsStubParser::getUmbrellaSection (const Object *File, const TargetList &Targets)
 
Expected< uint8_t > StubParser::getSwiftVersion (const Object *File)
 
Expected< PackedVersionStubParser::getPackedVersion (const Object *File, TBDKey Key)
 
Expected< TBDFlagsStubParser::getFlags (const Object *File)
 
Expected< IFPtr > StubParser::parseToInterfaceFile (const Object *File)
 
Expected< std::vector< IFPtr > > StubParser::getInlinedLibs (const Object *File)
 

Variables

std::array< StringRef, 64 > Keys
 

Typedef Documentation

◆ AttrToTargets

using AttrToTargets = std::map<std::string, TargetList>

Definition at line 81 of file TextStubV5.cpp.

◆ TargetsToSymbols

using TargetsToSymbols = SmallVector<std::pair<TargetList, std::vector<JSONSymbol> >>

Definition at line 82 of file TextStubV5.cpp.

Enumeration Type Documentation

◆ TBDKey

enum TBDKey : size_t
Enumerator
TBDVersion 
MainLibrary 
Documents 
TargetInfo 
Targets 
Target 
Deployment 
Flags 
Attributes 
InstallName 
CurrentVersion 
CompatibilityVersion 
Version 
SwiftABI 
ABI 
ParentUmbrella 
Umbrella 
AllowableClients 
Clients 
ReexportLibs 
Names 
Name 
Exports 
Reexports 
Undefineds 
Data 
Text 
Weak 
ThreadLocal 
Globals 
ObjCClass 
ObjCEHType 
ObjCIvar 
RPath 
Paths 

Definition at line 85 of file TextStubV5.cpp.

Function Documentation

◆ collectFromArray()

Error collectFromArray ( TBDKey  Key,
const Object Obj,
std::function< void(StringRef)>  Append,
bool  IsRequired = false 
)

◆ getParseErrorMsg()

static llvm::SmallString< 128 > getParseErrorMsg ( TBDKey  Key)
static

◆ getRequiredValue() [1/2]

template<typename JsonT , typename StubT = JsonT>
Expected< StubT > getRequiredValue ( TBDKey  Key,
const Object Obj,
std::function< std::optional< JsonT >(const Object *, StringRef)>  GetValue,
std::function< std::optional< StubT >(JsonT)>  Validate = nullptr 
)

Definition at line 183 of file TextStubV5.cpp.

References getParseErrorMsg(), and Keys.

◆ getRequiredValue() [2/2]

template<typename JsonT , typename StubT = JsonT>
Expected< StubT > getRequiredValue ( TBDKey  Key,
const Object Obj,
std::function< std::optional< JsonT >(const Object *, StringRef)>  GetValue,
StubT  DefaultValue,
std::function< std::optional< StubT >(JsonT)>  Validate 
)

Definition at line 201 of file TextStubV5.cpp.

References getParseErrorMsg(), and Keys.

◆ getSerializeErrorMsg()

static llvm::SmallString< 128 > getSerializeErrorMsg ( TBDKey  Key)
static

Definition at line 165 of file TextStubV5.cpp.

References Keys.

Variable Documentation

◆ Keys

std::array<StringRef, 64> Keys