From 0d861a24d87306543e9dc3657584bb9b26d110cc Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Wed, 5 Jun 2013 23:55:26 +0000 Subject: [PATCH] Remove error-prone methods of BinaryRef. A user shouldn't care about the internal state, and these methods by their very nature require asserting a predicate on the internal state. As such, they cannot be used safely without introducing hidden long-distance dependencies on the manner of construction of the BinaryRef. Use writeAsBinary(raw_ostream &) and writeAsHex(raw_ostream &) if you need to access the data in a binary or hex format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183353 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Object/YAML.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/llvm/Object/YAML.h b/include/llvm/Object/YAML.h index e349e35dd45..7f59dd1cbc8 100644 --- a/include/llvm/Object/YAML.h +++ b/include/llvm/Object/YAML.h @@ -36,14 +36,6 @@ public: : Data(reinterpret_cast(Data.data()), Data.size()), DataIsHexString(true) {} BinaryRef() : DataIsHexString(true) {} - StringRef getHex() const { - assert(DataIsHexString); - return StringRef(reinterpret_cast(Data.data()), Data.size()); - } - ArrayRef getBinary() const { - assert(!DataIsHexString); - return Data; - } /// \brief The number of bytes that are represented by this BinaryRef. /// This is the number of bytes that writeAsBinary() will write. ArrayRef::size_type binary_size() const {