mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-04 02:18:46 +00:00
[codeview] Drop unused private inheritance.
There is no polymorphism here, and StreamRef already contains a StreamInterface pointer. Dropping the base class makes StreamRef more transparent to the compiler, for example it can find unused variables. llvm-svn: 275013
This commit is contained in:
parent
301801e3bb
commit
8095a0cda8
@ -16,7 +16,7 @@
|
||||
namespace llvm {
|
||||
namespace codeview {
|
||||
|
||||
class StreamRef : private StreamInterface {
|
||||
class StreamRef {
|
||||
public:
|
||||
StreamRef() : Stream(nullptr), ViewOffset(0), Length(0) {}
|
||||
StreamRef(const StreamInterface &Stream)
|
||||
@ -28,7 +28,7 @@ public:
|
||||
StreamRef(const StreamRef &S, uint32_t Offset, uint32_t Length) = delete;
|
||||
|
||||
Error readBytes(uint32_t Offset, uint32_t Size,
|
||||
ArrayRef<uint8_t> &Buffer) const override {
|
||||
ArrayRef<uint8_t> &Buffer) const {
|
||||
if (ViewOffset + Offset < Offset)
|
||||
return make_error<CodeViewError>(cv_error_code::insufficient_buffer);
|
||||
if (Size + Offset > Length)
|
||||
@ -39,7 +39,7 @@ public:
|
||||
// Given an offset into the stream, read as much as possible without copying
|
||||
// any data.
|
||||
Error readLongestContiguousChunk(uint32_t Offset,
|
||||
ArrayRef<uint8_t> &Buffer) const override {
|
||||
ArrayRef<uint8_t> &Buffer) const {
|
||||
if (Offset >= Length)
|
||||
return make_error<CodeViewError>(cv_error_code::insufficient_buffer);
|
||||
|
||||
@ -54,15 +54,15 @@ public:
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> Data) const override {
|
||||
Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> Data) const {
|
||||
if (Data.size() + Offset > Length)
|
||||
return make_error<CodeViewError>(cv_error_code::insufficient_buffer);
|
||||
return Stream->writeBytes(ViewOffset + Offset, Data);
|
||||
}
|
||||
|
||||
uint32_t getLength() const override { return Length; }
|
||||
uint32_t getLength() const { return Length; }
|
||||
|
||||
Error commit() const override { return Stream->commit(); }
|
||||
Error commit() const { return Stream->commit(); }
|
||||
|
||||
StreamRef drop_front(uint32_t N) const {
|
||||
if (!Stream)
|
||||
|
@ -344,7 +344,6 @@ static void dumpTpiHash(ScopedPrinter &P, TpiStream &Tpi) {
|
||||
DictScope DD(P, "Hash");
|
||||
P.printNumber("Number of Hash Buckets", Tpi.NumHashBuckets());
|
||||
P.printNumber("Hash Key Size", Tpi.getHashKeySize());
|
||||
codeview::FixedStreamArray<support::ulittle32_t> S = Tpi.getHashValues();
|
||||
P.printList("Values", Tpi.getHashValues());
|
||||
P.printList("Type Index Offsets", Tpi.getTypeIndexOffsets(),
|
||||
printTypeIndexOffset);
|
||||
|
Loading…
x
Reference in New Issue
Block a user