1 //===-- GOFFYAML.cpp - GOFF YAMLIO implementation ---------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defines classes for handling the YAML representation of GOFF.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/ObjectYAML/GOFFYAML.h"
14 #include "llvm/BinaryFormat/GOFF.h"
22 } // namespace GOFFYAML
26 void MappingTraits
<GOFFYAML::FileHeader
>::mapping(
27 IO
&IO
, GOFFYAML::FileHeader
&FileHdr
) {
28 IO
.mapOptional("TargetEnvironment", FileHdr
.TargetEnvironment
, 0);
29 IO
.mapOptional("TargetOperatingSystem", FileHdr
.TargetOperatingSystem
, 0);
30 IO
.mapOptional("CCSID", FileHdr
.CCSID
, 0);
31 IO
.mapOptional("CharacterSetName", FileHdr
.CharacterSetName
, "");
32 IO
.mapOptional("LanguageProductIdentifier", FileHdr
.LanguageProductIdentifier
,
34 IO
.mapOptional("ArchitectureLevel", FileHdr
.ArchitectureLevel
, 1);
35 IO
.mapOptional("InternalCCSID", FileHdr
.InternalCCSID
);
36 IO
.mapOptional("TargetSoftwareEnvironment",
37 FileHdr
.TargetSoftwareEnvironment
);
40 void MappingTraits
<GOFFYAML::Object
>::mapping(IO
&IO
, GOFFYAML::Object
&Obj
) {
41 IO
.mapTag("!GOFF", true);
42 IO
.mapRequired("FileHeader", Obj
.Header
);