summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2017-02-25 17:04:23 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2017-02-25 17:04:23 +0000
commit05a75e40da0f83639111687799eaab2c07c00ef0 (patch)
tree8ade745eed4316647c5098f24acd74af027ff364 /llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
parent09ecd3117e151c645d2870409b5a78b2aeac326d (diff)
downloadbcm5719-llvm-05a75e40da0f83639111687799eaab2c07c00ef0.tar.gz
bcm5719-llvm-05a75e40da0f83639111687799eaab2c07c00ef0.zip
Revert r296215, "[PDB] General improvements to Stream library." and followings.
r296215, "[PDB] General improvements to Stream library." r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily." r296220, "Re-enable BinaryStreamTest.StreamReaderObject." r296244, "[PDB] Disable some tests that are breaking bots." r296249, "Add static_cast to silence -Wc++11-narrowing." std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission. (Seek discussions around llvm/xray.) I could substitute s/no_buffer_space/others/g, but I revert whole them ATM. Could we define and use LLVM errors there? llvm-svn: 296258
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp')
-rw-r--r--llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp48
1 files changed, 28 insertions, 20 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp b/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
index a204d43ba13..fd60059b5c6 100644
--- a/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
+++ b/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
@@ -87,13 +87,14 @@ Error CodeViewRecordIO::mapByteVectorTail(std::vector<uint8_t> &Bytes) {
Error CodeViewRecordIO::mapInteger(TypeIndex &TypeInd) {
if (isWriting()) {
- if (auto EC = Writer->writeInteger(TypeInd.getIndex()))
+ if (auto EC =
+ Writer->writeInteger(TypeInd.getIndex(), llvm::support::little))
return EC;
return Error::success();
}
uint32_t I;
- if (auto EC = Reader->readInteger(I))
+ if (auto EC = Reader->readInteger(I, llvm::support::little))
return EC;
TypeInd.setIndex(I);
return Error::success();
@@ -145,10 +146,10 @@ Error CodeViewRecordIO::mapStringZ(StringRef &Value) {
if (isWriting()) {
// Truncate if we attempt to write too much.
StringRef S = Value.take_front(maxFieldLength() - 1);
- if (auto EC = Writer->writeCString(S))
+ if (auto EC = Writer->writeZeroString(S))
return EC;
} else {
- if (auto EC = Reader->readCString(Value))
+ if (auto EC = Reader->readZeroString(Value))
return EC;
}
return Error::success();
@@ -176,7 +177,7 @@ Error CodeViewRecordIO::mapStringZVectorZ(std::vector<StringRef> &Value) {
if (auto EC = mapStringZ(V))
return EC;
}
- if (auto EC = Writer->writeInteger<uint8_t>(0))
+ if (auto EC = Writer->writeInteger<uint8_t>(0, llvm::support::little))
return EC;
} else {
StringRef S;
@@ -194,24 +195,28 @@ Error CodeViewRecordIO::mapStringZVectorZ(std::vector<StringRef> &Value) {
Error CodeViewRecordIO::writeEncodedSignedInteger(const int64_t &Value) {
assert(Value < 0 && "Encoded integer is not signed!");
if (Value >= std::numeric_limits<int8_t>::min()) {
- if (auto EC = Writer->writeInteger<uint16_t>(LF_CHAR))
+ if (auto EC =
+ Writer->writeInteger<uint16_t>(LF_CHAR, llvm::support::little))
return EC;
- if (auto EC = Writer->writeInteger<int8_t>(Value))
+ if (auto EC = Writer->writeInteger<int8_t>(Value, llvm::support::little))
return EC;
} else if (Value >= std::numeric_limits<int16_t>::min()) {
- if (auto EC = Writer->writeInteger<uint16_t>(LF_SHORT))
+ if (auto EC =
+ Writer->writeInteger<uint16_t>(LF_SHORT, llvm::support::little))
return EC;
- if (auto EC = Writer->writeInteger<int16_t>(Value))
+ if (auto EC = Writer->writeInteger<int16_t>(Value, llvm::support::little))
return EC;
} else if (Value >= std::numeric_limits<int32_t>::min()) {
- if (auto EC = Writer->writeInteger<uint16_t>(LF_LONG))
+ if (auto EC =
+ Writer->writeInteger<uint16_t>(LF_LONG, llvm::support::little))
return EC;
- if (auto EC = Writer->writeInteger<int32_t>(Value))
+ if (auto EC = Writer->writeInteger<int32_t>(Value, llvm::support::little))
return EC;
} else {
- if (auto EC = Writer->writeInteger<uint16_t>(LF_QUADWORD))
+ if (auto EC =
+ Writer->writeInteger<uint16_t>(LF_QUADWORD, llvm::support::little))
return EC;
- if (auto EC = Writer->writeInteger(Value))
+ if (auto EC = Writer->writeInteger(Value, llvm::support::little))
return EC;
}
return Error::success();
@@ -219,22 +224,25 @@ Error CodeViewRecordIO::writeEncodedSignedInteger(const int64_t &Value) {
Error CodeViewRecordIO::writeEncodedUnsignedInteger(const uint64_t &Value) {
if (Value < LF_NUMERIC) {
- if (auto EC = Writer->writeInteger<uint16_t>(Value))
+ if (auto EC = Writer->writeInteger<uint16_t>(Value, llvm::support::little))
return EC;
} else if (Value <= std::numeric_limits<uint16_t>::max()) {
- if (auto EC = Writer->writeInteger<uint16_t>(LF_USHORT))
+ if (auto EC =
+ Writer->writeInteger<uint16_t>(LF_USHORT, llvm::support::little))
return EC;
- if (auto EC = Writer->writeInteger<uint16_t>(Value))
+ if (auto EC = Writer->writeInteger<uint16_t>(Value, llvm::support::little))
return EC;
} else if (Value <= std::numeric_limits<uint32_t>::max()) {
- if (auto EC = Writer->writeInteger<uint16_t>(LF_ULONG))
+ if (auto EC =
+ Writer->writeInteger<uint16_t>(LF_ULONG, llvm::support::little))
return EC;
- if (auto EC = Writer->writeInteger<uint32_t>(Value))
+ if (auto EC = Writer->writeInteger<uint32_t>(Value, llvm::support::little))
return EC;
} else {
- if (auto EC = Writer->writeInteger<uint16_t>(LF_UQUADWORD))
+ if (auto EC =
+ Writer->writeInteger<uint16_t>(LF_UQUADWORD, llvm::support::little))
return EC;
- if (auto EC = Writer->writeInteger(Value))
+ if (auto EC = Writer->writeInteger(Value, llvm::support::little))
return EC;
}
OpenPOWER on IntegriCloud