forked from OSchip/llvm-project
[llvm-bcanalyzer] Simplify code. NFCI.
This commit is contained in:
parent
9fa38c985f
commit
9a9bc23672
|
@ -910,17 +910,14 @@ Error BitcodeAnalyzer::parseBlock(unsigned BlockID, unsigned IndentLevel,
|
|||
Hasher.update(ArrayRef<uint8_t>(Ptr, BlockSize));
|
||||
Hash = Hasher.result();
|
||||
}
|
||||
SmallString<20> RecordedHash;
|
||||
RecordedHash.resize(20);
|
||||
std::array<char, 20> RecordedHash;
|
||||
int Pos = 0;
|
||||
for (auto &Val : Record) {
|
||||
assert(!(Val >> 32) && "Unexpected high bits set");
|
||||
RecordedHash[Pos++] = (Val >> 24) & 0xFF;
|
||||
RecordedHash[Pos++] = (Val >> 16) & 0xFF;
|
||||
RecordedHash[Pos++] = (Val >> 8) & 0xFF;
|
||||
RecordedHash[Pos++] = (Val >> 0) & 0xFF;
|
||||
support::endian::write32be(&RecordedHash[Pos], Val);
|
||||
Pos += 4;
|
||||
}
|
||||
if (Hash == RecordedHash)
|
||||
if (Hash == StringRef(RecordedHash.data(), RecordedHash.size()))
|
||||
O->OS << " (match)";
|
||||
else
|
||||
O->OS << " (!mismatch!)";
|
||||
|
|
Loading…
Reference in New Issue