summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSean Silva <silvas@purdue.edu>2013-06-05 22:59:00 +0000
committerSean Silva <silvas@purdue.edu>2013-06-05 22:59:00 +0000
commit639adc59f86d0526dbace4a1ecc4924c6c52e1cd (patch)
treebec0b440b3d87fd170c30f77a171a60da639a999 /include
parentf3d6e32c09ac73b49628f5ec7066af5eca2737b5 (diff)
downloadllvm-639adc59f86d0526dbace4a1ecc4924c6c52e1cd.tar.gz
llvm-639adc59f86d0526dbace4a1ecc4924c6c52e1cd.tar.bz2
llvm-639adc59f86d0526dbace4a1ecc4924c6c52e1cd.tar.xz
Add writeAsBinary(raw_ostream &) method to BinaryRef.
Previously, yaml2coff.cpp had a writeHexData static helper function to do this, but it is generally useful functionality. Also, validate hex strings up-front to avoid running having to handle errors "deep inside" the yaml2obj code (it also gives better diagnostics than it used to). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183345 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Object/YAML.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Object/YAML.h b/include/llvm/Object/YAML.h
index 304454bd73..5e658f13d0 100644
--- a/include/llvm/Object/YAML.h
+++ b/include/llvm/Object/YAML.h
@@ -48,6 +48,9 @@ public:
return Ref.isBinary == isBinary && Ref.Data == Data;
}
+ /// \brief 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;
};
}