1 //===--- yaml2obj.h - -------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 /// Common declarations for yaml2obj
10 //===----------------------------------------------------------------------===//
11 #ifndef LLVM_TOOLS_YAML2OBJ_YAML2OBJ_H
12 #define LLVM_TOOLS_YAML2OBJ_YAML2OBJ_H
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/Support/Error.h"
20 template <typename T
> class SmallVectorImpl
;
21 template <typename T
> class Expected
;
35 namespace MinidumpYAML
{
45 struct YamlObjectFile
;
47 int yaml2coff(COFFYAML::Object
&Doc
, raw_ostream
&Out
);
48 int yaml2elf(ELFYAML::Object
&Doc
, raw_ostream
&Out
);
49 int yaml2macho(YamlObjectFile
&Doc
, raw_ostream
&Out
);
50 int yaml2minidump(MinidumpYAML::Object
&Doc
, raw_ostream
&Out
);
51 int yaml2wasm(WasmYAML::Object
&Doc
, raw_ostream
&Out
);
53 Error
convertYAML(Input
&YIn
, raw_ostream
&Out
, unsigned DocNum
= 1);
55 /// Convenience function for tests.
56 Expected
<std::unique_ptr
<object::ObjectFile
>>
57 yaml2ObjectFile(SmallVectorImpl
<char> &Storage
, StringRef Yaml
);