Go to the documentation of this file.
23 unsigned CurDocNum = 0;
25 if (++CurDocNum != DocNum)
30 if (std::error_code EC = YIn.error()) {
31 ErrHandler(
"failed to parse YAML input: " + EC.message());
38 return yaml2elf(*Doc.Elf, Out, ErrHandler, MaxSize);
40 return yaml2coff(*Doc.Coff, Out, ErrHandler);
41 if (Doc.MachO || Doc.FatMachO)
46 return yaml2wasm(*Doc.Wasm, Out, ErrHandler);
48 return yaml2xcoff(*Doc.Xcoff, Out, ErrHandler);
52 ErrHandler(
"unknown document type");
55 }
while (YIn.nextDocument());
57 ErrHandler(
"cannot find the " +
Twine(DocNum) +
58 getOrdinalSuffix(DocNum).data() +
" document");
62 std::unique_ptr<object::ObjectFile>
68 yaml::Input YIn(Yaml);
This is an optimization pass for GlobalISel generic memory operations.
bool yaml2xcoff(XCOFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
Tagged union holding either a T or a Error.
bool yaml2macho(YamlObjectFile &Doc, raw_ostream &Out, ErrorHandler EH)
bool yaml2archive(ArchYAML::Archive &Doc, raw_ostream &Out, ErrorHandler EH)
bool yaml2coff(COFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
bool yaml2elf(ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH, uint64_t MaxSize)
This class implements an extremely fast bulk output stream that can only output to a stream.
bool yaml2dxcontainer(DXContainerYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
An efficient, type-erasing, non-owning reference to a callable.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
StringRef - Represent a constant reference to a string, i.e.
StringRef str() const
Return a StringRef for the vector contents.
bool yaml2wasm(WasmYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
const char * toString(DWARFSectionKind Kind)
bool yaml2minidump(MinidumpYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
std::unique_ptr< object::ObjectFile > yaml2ObjectFile(SmallVectorImpl< char > &Storage, StringRef Yaml, ErrorHandler ErrHandler)
Convenience function for tests.
Error takeError()
Take ownership of the stored error.
bool convertYAML(Input &YIn, raw_ostream &Out, ErrorHandler ErrHandler, unsigned DocNum=1, uint64_t MaxSize=UINT64_MAX)
A raw_ostream that writes to an SmallVector or SmallString.