20using namespace object;
23 :
Binary(ID_TapiUniversal, Source) {
27 Err = Result.takeError();
30 ParsedFile = std::move(Result.get());
32 auto FlattenObjectInfo = [
this](
const auto &File,
33 std::optional<size_t> DocIdx = std::nullopt) {
36 Libraries.emplace_back(Library({
Name, Arch, DocIdx}));
38 FlattenObjectInfo(ParsedFile);
41 for (
const std::shared_ptr<InterfaceFile> &File : ParsedFile->documents())
42 FlattenObjectInfo(File, DocIdx++);
49 const auto &InlinedDocuments = Parent->ParsedFile->documents();
50 const Library &CurrLib = Parent->Libraries[Index];
53 (InlinedDocuments.size() > *CurrLib.DocumentIdx))) &&
54 "Index into documents exceeds the container for them");
56 ? Parent->ParsedFile.get()
57 : InlinedDocuments[*CurrLib.DocumentIdx].get();
65 std::unique_ptr<TapiUniversal> Ret(
new TapiUniversal(Source, Err));
67 return std::move(Err);
68 return std::move(Ret);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Helper for Errors used as out-parameters.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Defines the interface file.
static LLVM_ABI Expected< std::unique_ptr< InterfaceFile > > get(MemoryBufferRef InputBuffer)
Parse and get an InterfaceFile that represents the full library.
StringRef - Represent a constant reference to a string, i.e.
MemoryBufferRef getMemoryBufferRef() const
bool isTopLevelLib() const
LLVM_ABI Expected< std::unique_ptr< TapiFile > > getAsObjectFile() const
~TapiUniversal() override
TapiUniversal(MemoryBufferRef Source, Error &Err)
static Expected< std::unique_ptr< TapiUniversal > > create(MemoryBufferRef Source)
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
This is an optimization pass for GlobalISel generic memory operations.