mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-26 07:29:55 +00:00
It will be used for ELF dumping too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183287 91177308-0d34-0410-b5e6-96231b3b80d8
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
//===- YAML.cpp - YAMLIO utilities for object files -----------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines utility classes for handling the YAML representation of
|
|
// object files.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/Object/YAML.h"
|
|
|
|
using namespace llvm;
|
|
|
|
void yaml::ScalarTraits<object::yaml::BinaryRef>::output(
|
|
const object::yaml::BinaryRef &Val, void *, llvm::raw_ostream &Out) {
|
|
ArrayRef<uint8_t> Data = Val.getBinary();
|
|
for (ArrayRef<uint8_t>::iterator I = Data.begin(), E = Data.end(); I != E;
|
|
++I) {
|
|
uint8_t Byte = *I;
|
|
Out << hexdigit(Byte >> 4);
|
|
Out << hexdigit(Byte & 0xf);
|
|
}
|
|
}
|
|
|
|
StringRef yaml::ScalarTraits<object::yaml::BinaryRef>::input(
|
|
StringRef Scalar, void *, object::yaml::BinaryRef &Val) {
|
|
Val = object::yaml::BinaryRef(Scalar);
|
|
return StringRef();
|
|
}
|