[InstCombine] Signed saturation patterns
[llvm-complete.git] / include / llvm / ObjectYAML / yaml2obj.h
blob386551337d86283a51cf07c18f4de9cef12e88a2
1 //===--- yaml2obj.h - -------------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 /// \file
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"
16 #include <memory>
18 namespace llvm {
19 class raw_ostream;
20 template <typename T> class SmallVectorImpl;
21 template <typename T> class Expected;
23 namespace object {
24 class ObjectFile;
27 namespace COFFYAML {
28 struct Object;
31 namespace ELFYAML {
32 struct Object;
35 namespace MinidumpYAML {
36 struct Object;
39 namespace WasmYAML {
40 struct Object;
43 namespace yaml {
44 class Input;
45 struct YamlObjectFile;
47 using ErrorHandler = llvm::function_ref<void(const Twine &Msg)>;
49 bool yaml2coff(COFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
50 bool yaml2elf(ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
51 bool yaml2macho(YamlObjectFile &Doc, raw_ostream &Out, ErrorHandler EH);
52 bool yaml2minidump(MinidumpYAML::Object &Doc, raw_ostream &Out,
53 ErrorHandler EH);
54 bool yaml2wasm(WasmYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
56 bool convertYAML(Input &YIn, raw_ostream &Out, ErrorHandler ErrHandler,
57 unsigned DocNum = 1);
59 /// Convenience function for tests.
60 std::unique_ptr<object::ObjectFile>
61 yaml2ObjectFile(SmallVectorImpl<char> &Storage, StringRef Yaml,
62 ErrorHandler ErrHandler);
64 } // namespace yaml
65 } // namespace llvm
67 #endif