MIRYamlMapping.h revision 284236
11553Srgrimes//===- MIRYAMLMapping.h - Describes the mapping between MIR and YAML ------===// 21553Srgrimes// 31553Srgrimes// The LLVM Compiler Infrastructure 41553Srgrimes// 51553Srgrimes// This file is distributed under the University of Illinois Open Source 61553Srgrimes// License. See LICENSE.TXT for details. 71553Srgrimes// 81553Srgrimes//===----------------------------------------------------------------------===// 91553Srgrimes// 101553Srgrimes// The MIR serialization library is currently a work in progress. It can't 111553Srgrimes// serialize machine functions at this time. 121553Srgrimes// 131553Srgrimes// This file implements the mapping between various MIR data structures and 141553Srgrimes// their corresponding YAML representation. 151553Srgrimes// 161553Srgrimes//===----------------------------------------------------------------------===// 171553Srgrimes 181553Srgrimes#ifndef LLVM_LIB_CODEGEN_MIRYAMLMAPPING_H 191553Srgrimes#define LLVM_LIB_CODEGEN_MIRYAMLMAPPING_H 201553Srgrimes 211553Srgrimes#include "llvm/ADT/StringRef.h" 221553Srgrimes#include "llvm/Support/YAMLTraits.h" 231553Srgrimes 241553Srgrimesnamespace llvm { 251553Srgrimesnamespace yaml { 261553Srgrimes 271553Srgrimesstruct MachineFunction { 281553Srgrimes StringRef Name; 291553Srgrimes}; 301553Srgrimes 3130642Scharniertemplate <> struct MappingTraits<MachineFunction> { 321553Srgrimes static void mapping(IO &YamlIO, MachineFunction &MF) { 3330642Scharnier YamlIO.mapRequired("name", MF.Name); 3430642Scharnier } 3550479Speter}; 361553Srgrimes 371553Srgrimes} // end namespace yaml 381553Srgrimes} // end namespace llvm 391553Srgrimes 40202204Sed#endif 411553Srgrimes