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_MCANALYSIS_MCMODULEYAML_H 17 #define LLVM_MC_MCANALYSIS_MCMODULEYAML_H 18 19 #include "llvm/ADT/StringRef.h" 20 #include "llvm/MC/MCAnalysis/MCModule.h" 21 #include "llvm/Support/raw_ostream.h" 22 23 namespace llvm { 24 25 class MCInstrInfo; 26 class MCRegisterInfo; 27 28 /// \brief Dump a YAML representation of the MCModule \p MCM to \p OS. 29 /// \returns The empty string on success, an error message on failure. 30 StringRef mcmodule2yaml(raw_ostream &OS, const MCModule &MCM, 31 const MCInstrInfo &MII, const MCRegisterInfo &MRI); 32 33 /// \brief Creates a new module and returns it in \p MCM. 34 /// \returns The empty string on success, an error message on failure. 35 StringRef yaml2mcmodule(std::unique_ptr<MCModule> &MCM, StringRef YamlContent, 36 const MCInstrInfo &MII, const MCRegisterInfo &MRI); 37 38 } // end namespace llvm 39 40 #endif 41