summaryrefslogtreecommitdiff
path: root/include/llvm/Object/YAML.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Object/YAML.h')
-rw-r--r--include/llvm/Object/YAML.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Object/YAML.h b/include/llvm/Object/YAML.h
index e6f1da1e1d..92811b04eb 100644
--- a/include/llvm/Object/YAML.h
+++ b/include/llvm/Object/YAML.h
@@ -43,6 +43,13 @@ public:
assert(isBinary);
return Data;
}
+ /// \brief 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 (!isBinary)
+ return Data.size() / 2;
+ return Data.size();
+ }
bool operator==(const BinaryRef &Ref) {
// Special case for default constructed BinaryRef.
if (Ref.Data.empty() && Data.empty())