MCModuleYAML.h revision 263508
1//===- MCModuleYAML.h - MCModule YAMLIO implementation ----------*- 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//===----------------------------------------------------------------------===//
9///
10/// \file
11/// \brief This file declares classes for handling the YAML representation
12/// of MCModule.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_MC_MCMODULEYAML_H
17#define LLVM_MC_MCMODULEYAML_H
18
19#include "llvm/ADT/OwningPtr.h"
20#include "llvm/ADT/StringRef.h"
21#include "llvm/MC/MCModule.h"
22#include "llvm/Support/raw_ostream.h"
23
24namespace llvm {
25
26class MCInstrInfo;
27class MCRegisterInfo;
28
29/// \brief Dump a YAML representation of the MCModule \p MCM to \p OS.
30/// \returns The empty string on success, an error message on failure.
31StringRef mcmodule2yaml(raw_ostream &OS, const MCModule &MCM,
32                        const MCInstrInfo &MII, const MCRegisterInfo &MRI);
33
34/// \brief Creates a new module and returns it in \p MCM.
35/// \returns The empty string on success, an error message on failure.
36StringRef yaml2mcmodule(OwningPtr<MCModule> &MCM, StringRef YamlContent,
37                        const MCInstrInfo &MII, const MCRegisterInfo &MRI);
38
39} // end namespace llvm
40
41#endif
42