[llvm] r275013 - [codeview] Drop unused private inheritance.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 10 03:17:37 PDT 2016


Author: d0k
Date: Sun Jul 10 05:17:36 2016
New Revision: 275013

URL: http://llvm.org/viewvc/llvm-project?rev=275013&view=rev
Log:
[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.

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

Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/StreamRef.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/StreamRef.h?rev=275013&r1=275012&r2=275013&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/StreamRef.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/StreamRef.h Sun Jul 10 05:17:36 2016
@@ -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)

Modified: llvm/trunk/tools/llvm-pdbdump/LLVMOutputStyle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/LLVMOutputStyle.cpp?rev=275013&r1=275012&r2=275013&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/LLVMOutputStyle.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/LLVMOutputStyle.cpp Sun Jul 10 05:17:36 2016
@@ -344,7 +344,6 @@ static void dumpTpiHash(ScopedPrinter &P
   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);




More information about the llvm-commits mailing list