1 //===- YAML.cpp - YAMLIO utilities for object files -----------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines utility classes for handling the YAML representation of
13 //===----------------------------------------------------------------------===//
15 #include "llvm/Object/YAML.h"
19 void yaml::ScalarTraits<object::yaml::BinaryRef>::output(
20 const object::yaml::BinaryRef &Val, void *, llvm::raw_ostream &Out) {
21 ArrayRef<uint8_t> Data = Val.getBinary();
22 for (ArrayRef<uint8_t>::iterator I = Data.begin(), E = Data.end(); I != E;
25 Out << hexdigit(Byte >> 4);
26 Out << hexdigit(Byte & 0xf);
30 StringRef yaml::ScalarTraits<object::yaml::BinaryRef>::input(
31 StringRef Scalar, void *, object::yaml::BinaryRef &Val) {
32 Val = object::yaml::BinaryRef(Scalar);