Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:22

0001 //===--- yaml2obj.h - -------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 /// \file
0009 /// Common declarations for yaml2obj
0010 //===----------------------------------------------------------------------===//
0011 #ifndef LLVM_OBJECTYAML_YAML2OBJ_H
0012 #define LLVM_OBJECTYAML_YAML2OBJ_H
0013 
0014 #include "llvm/ADT/STLExtras.h"
0015 #include <memory>
0016 
0017 namespace llvm {
0018 class raw_ostream;
0019 template <typename T> class SmallVectorImpl;
0020 class StringRef;
0021 class Twine;
0022 
0023 namespace object {
0024 class ObjectFile;
0025 }
0026 
0027 namespace COFFYAML {
0028 struct Object;
0029 }
0030 
0031 namespace ELFYAML {
0032 struct Object;
0033 }
0034 
0035 namespace GOFFYAML {
0036 struct Object;
0037 }
0038 
0039 namespace MinidumpYAML {
0040 struct Object;
0041 }
0042 
0043 namespace OffloadYAML {
0044 struct Binary;
0045 }
0046 
0047 namespace WasmYAML {
0048 struct Object;
0049 }
0050 
0051 namespace XCOFFYAML {
0052 struct Object;
0053 }
0054 
0055 namespace ArchYAML {
0056 struct Archive;
0057 }
0058 
0059 namespace DXContainerYAML {
0060 struct Object;
0061 } // namespace DXContainerYAML
0062 
0063 namespace yaml {
0064 class Input;
0065 struct YamlObjectFile;
0066 
0067 using ErrorHandler = llvm::function_ref<void(const Twine &Msg)>;
0068 
0069 bool yaml2archive(ArchYAML::Archive &Doc, raw_ostream &Out, ErrorHandler EH);
0070 bool yaml2coff(COFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
0071 bool yaml2goff(GOFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
0072 bool yaml2elf(ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH,
0073               uint64_t MaxSize);
0074 bool yaml2macho(YamlObjectFile &Doc, raw_ostream &Out, ErrorHandler EH);
0075 bool yaml2minidump(MinidumpYAML::Object &Doc, raw_ostream &Out,
0076                    ErrorHandler EH);
0077 bool yaml2offload(OffloadYAML::Binary &Doc, raw_ostream &Out, ErrorHandler EH);
0078 bool yaml2wasm(WasmYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
0079 bool yaml2xcoff(XCOFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
0080 bool yaml2dxcontainer(DXContainerYAML::Object &Doc, raw_ostream &Out,
0081                       ErrorHandler EH);
0082 
0083 bool convertYAML(Input &YIn, raw_ostream &Out, ErrorHandler ErrHandler,
0084                  unsigned DocNum = 1, uint64_t MaxSize = UINT64_MAX);
0085 
0086 /// Convenience function for tests.
0087 std::unique_ptr<object::ObjectFile>
0088 yaml2ObjectFile(SmallVectorImpl<char> &Storage, StringRef Yaml,
0089                 ErrorHandler ErrHandler);
0090 
0091 } // namespace yaml
0092 } // namespace llvm
0093 
0094 #endif