Path: blob/main/contrib/llvm-project/llvm/lib/ObjectYAML/GOFFYAML.cpp
35233 views
//===-- GOFFYAML.cpp - GOFF YAMLIO implementation ---------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file defines classes for handling the YAML representation of GOFF.9//10//===----------------------------------------------------------------------===//1112#include "llvm/ObjectYAML/GOFFYAML.h"13#include "llvm/BinaryFormat/GOFF.h"14#include <string.h>1516namespace llvm {17namespace GOFFYAML {1819Object::Object() {}2021} // namespace GOFFYAML2223namespace yaml {2425void MappingTraits<GOFFYAML::FileHeader>::mapping(26IO &IO, GOFFYAML::FileHeader &FileHdr) {27IO.mapOptional("TargetEnvironment", FileHdr.TargetEnvironment, 0);28IO.mapOptional("TargetOperatingSystem", FileHdr.TargetOperatingSystem, 0);29IO.mapOptional("CCSID", FileHdr.CCSID, 0);30IO.mapOptional("CharacterSetName", FileHdr.CharacterSetName, "");31IO.mapOptional("LanguageProductIdentifier", FileHdr.LanguageProductIdentifier,32"");33IO.mapOptional("ArchitectureLevel", FileHdr.ArchitectureLevel, 1);34IO.mapOptional("InternalCCSID", FileHdr.InternalCCSID);35IO.mapOptional("TargetSoftwareEnvironment",36FileHdr.TargetSoftwareEnvironment);37}3839void MappingTraits<GOFFYAML::Object>::mapping(IO &IO, GOFFYAML::Object &Obj) {40IO.mapTag("!GOFF", true);41IO.mapRequired("FileHeader", Obj.Header);42}4344} // namespace yaml45} // namespace llvm464748