Use a PointerUnion in MCSymbol for Section and Fragment. NFC.
[oota-llvm.git] / include / llvm / CodeGen / MIRYamlMapping.h
1 //===- MIRYAMLMapping.h - Describes the mapping between MIR and YAML ------===//
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 // The MIR serialization library is currently a work in progress. It can't
11 // serialize machine functions at this time.
12 //
13 // This file implements the mapping between various MIR data structures and
14 // their corresponding YAML representation.
15 //
16 //===----------------------------------------------------------------------===//
17
18 #ifndef LLVM_LIB_CODEGEN_MIRYAMLMAPPING_H
19 #define LLVM_LIB_CODEGEN_MIRYAMLMAPPING_H
20
21 #include "llvm/ADT/StringRef.h"
22 #include "llvm/Support/YAMLTraits.h"
23
24 namespace llvm {
25 namespace yaml {
26
27 struct MachineFunction {
28   StringRef Name;
29 };
30
31 template <> struct MappingTraits<MachineFunction> {
32   static void mapping(IO &YamlIO, MachineFunction &MF) {
33     YamlIO.mapRequired("name", MF.Name);
34   }
35 };
36
37 } // end namespace yaml
38 } // end namespace llvm
39
40 #endif