]> granicus.if.org Git - llvm/commitdiff
[codeview] Drop unused private inheritance.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 10 Jul 2016 10:17:36 +0000 (10:17 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 10 Jul 2016 10:17:36 +0000 (10:17 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275013 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DebugInfo/CodeView/StreamRef.h
tools/llvm-pdbdump/LLVMOutputStyle.cpp

index 22c4bdb594108cc4540842ca0fe20e3613406488..a4f244a322899ad5481ff2fe0e78a40824ae2ebc 100644 (file)
@@ -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)
index c24d364885d506450408868bff9887dd686a410d..d8eefa0837746c55a78614081707858b8c0ee72e 100644 (file)
@@ -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);