Mercurial > hg > CbC > CbC_llvm
diff include/llvm/ObjectYAML/YAML.h @ 148:63bd29f05246
merged
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 14 Aug 2019 19:46:37 +0900 |
parents | c2174574ed3a |
children |
line wrap: on
line diff
--- a/include/llvm/ObjectYAML/YAML.h Sun Dec 23 19:23:36 2018 +0900 +++ b/include/llvm/ObjectYAML/YAML.h Wed Aug 14 19:46:37 2019 +0900 @@ -1,9 +1,8 @@ //===- YAML.h ---------------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -21,7 +20,7 @@ namespace yaml { -/// \brief Specialized YAMLIO scalar type for representing a binary blob. +/// Specialized YAMLIO scalar type for representing a binary blob. /// /// A typical use case would be to represent the content of a section in a /// binary file. @@ -64,20 +63,19 @@ class BinaryRef { friend bool operator==(const BinaryRef &LHS, const BinaryRef &RHS); - /// \brief Either raw binary data, or a string of hex bytes (must always + /// Either raw binary data, or a string of hex bytes (must always /// be an even number of characters). ArrayRef<uint8_t> Data; - /// \brief Discriminator between the two states of the `Data` member. + /// Discriminator between the two states of the `Data` member. bool DataIsHexString = true; public: BinaryRef() = default; BinaryRef(ArrayRef<uint8_t> Data) : Data(Data), DataIsHexString(false) {} - BinaryRef(StringRef Data) - : Data(reinterpret_cast<const uint8_t *>(Data.data()), Data.size()) {} + BinaryRef(StringRef Data) : Data(arrayRefFromStringRef(Data)) {} - /// \brief The number of bytes that are represented by this BinaryRef. + /// The number of bytes that are represented by this BinaryRef. /// This is the number of bytes that writeAsBinary() will write. ArrayRef<uint8_t>::size_type binary_size() const { if (DataIsHexString) @@ -85,11 +83,11 @@ return Data.size(); } - /// \brief Write the contents (regardless of whether it is binary or a + /// Write the contents (regardless of whether it is binary or a /// hex string) as binary to the given raw_ostream. void writeAsBinary(raw_ostream &OS) const; - /// \brief Write the contents (regardless of whether it is binary or a + /// Write the contents (regardless of whether it is binary or a /// hex string) as hex to the given raw_ostream. /// /// For example, a possible output could be `DEADBEEFCAFEBABE`.