1//===------ utils/obj2yaml.hpp - obj2yaml conversion tool -------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8// This file declares some helper routines, and also the format-specific
9// writers. To add a new format, add the declaration here, and, in a separate
10// source file, implement it.
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_UTILS_OBJ2YAML_H
14#define LLVM_UTILS_OBJ2YAML_H
15
16#include "llvm/ADT/ArrayRef.h"
17
18#include "llvm/Support/system_error.h"
19#include "llvm/Support/raw_ostream.h"
20#include "llvm/Support/MemoryBuffer.h"
21
22namespace yaml {  // routines for writing YAML
23// Write a hex stream:
24//    <Prefix> !hex: "<hex digits>" #|<ASCII chars>\n
25  llvm::raw_ostream &writeHexStream
26    (llvm::raw_ostream &Out, const llvm::ArrayRef<uint8_t> arr);
27
28// Writes a number in hex; prefix it by 0x if it is >= 10
29  llvm::raw_ostream &writeHexNumber
30    (llvm::raw_ostream &Out, unsigned long long N);
31}
32
33llvm::error_code coff2yaml(llvm::raw_ostream &Out, llvm::MemoryBuffer *TheObj);
34
35#endif
36