22 unsigned CurDocNum = 0;
24 if (++CurDocNum != DocNum)
29 if (std::error_code EC = YIn.error()) {
30 ErrHandler(
"failed to parse YAML input: " + EC.message());
37 return yaml2elf(*Doc.
Elf, Out, ErrHandler, MaxSize);
55 ErrHandler(
"unknown document type");
58 }
while (YIn.nextDocument());
60 ErrHandler(
"cannot find the " +
Twine(DocNum) +
61 getOrdinalSuffix(DocNum).data() +
" document");
65std::unique_ptr<object::ObjectFile>
71 yaml::Input YIn(Yaml);
79 return std::move(*ObjOrErr);
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
An efficient, type-erasing, non-owning reference to a callable.
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
bool yaml2dxcontainer(DXContainerYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
bool yaml2elf(ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH, uint64_t MaxSize)
bool yaml2goff(GOFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
bool yaml2coff(COFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
bool convertYAML(Input &YIn, raw_ostream &Out, ErrorHandler ErrHandler, unsigned DocNum=1, uint64_t MaxSize=UINT64_MAX)
bool yaml2wasm(WasmYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
bool yaml2offload(OffloadYAML::Binary &Doc, raw_ostream &Out, ErrorHandler EH)
std::unique_ptr< object::ObjectFile > yaml2ObjectFile(SmallVectorImpl< char > &Storage, StringRef Yaml, ErrorHandler ErrHandler)
Convenience function for tests.
bool yaml2xcoff(XCOFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
bool yaml2macho(YamlObjectFile &Doc, raw_ostream &Out, ErrorHandler EH)
bool yaml2archive(ArchYAML::Archive &Doc, raw_ostream &Out, ErrorHandler EH)
bool yaml2minidump(MinidumpYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
This is an optimization pass for GlobalISel generic memory operations.
const char * toString(DWARFSectionKind Kind)
std::unique_ptr< MachOYAML::UniversalBinary > FatMachO
std::unique_ptr< XCOFFYAML::Object > Xcoff
std::unique_ptr< OffloadYAML::Binary > Offload
std::unique_ptr< MachOYAML::Object > MachO
std::unique_ptr< ArchYAML::Archive > Arch
std::unique_ptr< COFFYAML::Object > Coff
std::unique_ptr< ELFYAML::Object > Elf
std::unique_ptr< GOFFYAML::Object > Goff
std::unique_ptr< WasmYAML::Object > Wasm
std::unique_ptr< DXContainerYAML::Object > DXContainer
std::unique_ptr< MinidumpYAML::Object > Minidump
Common declarations for yaml2obj.