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
diff --git a/llvm/lib/DebugInfo/MSF/StreamWriter.cpp b/llvm/lib/DebugInfo/MSF/StreamWriter.cpp
index a91cffe..cdae7c5 100644
--- a/llvm/lib/DebugInfo/MSF/StreamWriter.cpp
+++ b/llvm/lib/DebugInfo/MSF/StreamWriter.cpp
@@ -25,6 +25,8 @@
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 @@
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;