summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/MSF/StreamWriter.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-02 17:05:19 +0000
committerZachary Turner <zturner@google.com>2016-11-02 17:05:19 +0000
commit7251ede7c5ee82d25e309b6a30952a6b5e7c1f89 (patch)
tree3b4fb352c4fb41db708e3778d3e1aef75a47eed0 /llvm/lib/DebugInfo/MSF/StreamWriter.cpp
parent368972c3b3b8ad62fa064b495223809074c39115 (diff)
downloadbcm5719-llvm-7251ede7c5ee82d25e309b6a30952a6b5e7c1f89.tar.gz
bcm5719-llvm-7251ede7c5ee82d25e309b6a30952a6b5e7c1f89.zip
Add CodeViewRecordIO for reading and writing.
Using a pattern similar to that of YamlIO, this allows us to have a single codepath for translating codeview records to and from serialized byte streams. The current patch only hooks this up to the reading of CodeView type records. A subsequent patch will hook it up for writing of CodeView type records, and then a third patch will hook up the reading and writing of CodeView symbols. Differential Revision: https://reviews.llvm.org/D26040 llvm-svn: 285836
Diffstat (limited to 'llvm/lib/DebugInfo/MSF/StreamWriter.cpp')
-rw-r--r--llvm/lib/DebugInfo/MSF/StreamWriter.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/MSF/StreamWriter.cpp b/llvm/lib/DebugInfo/MSF/StreamWriter.cpp
index a91cffe840f..cdae7c5acc0 100644
--- a/llvm/lib/DebugInfo/MSF/StreamWriter.cpp
+++ b/llvm/lib/DebugInfo/MSF/StreamWriter.cpp
@@ -25,6 +25,8 @@ Error StreamWriter::writeBytes(ArrayRef<uint8_t> Buffer) {
return Error::success();
}
+Error StreamWriter::writeInteger(uint8_t Int) { return writeObject(Int); }
+
Error StreamWriter::writeInteger(uint16_t Int) {
return writeObject(support::ulittle16_t(Int));
}
@@ -33,6 +35,24 @@ Error StreamWriter::writeInteger(uint32_t Int) {
return writeObject(support::ulittle32_t(Int));
}
+Error StreamWriter::writeInteger(uint64_t Int) {
+ return writeObject(support::ulittle64_t(Int));
+}
+
+Error StreamWriter::writeInteger(int8_t Int) { return writeObject(Int); }
+
+Error StreamWriter::writeInteger(int16_t Int) {
+ return writeObject(support::little16_t(Int));
+}
+
+Error StreamWriter::writeInteger(int32_t Int) {
+ return writeObject(support::little32_t(Int));
+}
+
+Error StreamWriter::writeInteger(int64_t Int) {
+ return writeObject(support::little64_t(Int));
+}
+
Error StreamWriter::writeZeroString(StringRef Str) {
if (auto EC = writeFixedString(Str))
return EC;
OpenPOWER on IntegriCloud