forked from OSchip/llvm-project
[Support] Remove unnecessary MemoryBuffer::anchor (where the destructor serves as the key function)
llvm-svn: 338175
This commit is contained in:
parent
c3e11bf3f7
commit
c39ea92359
|
@ -43,7 +43,6 @@ class MemoryBuffer {
|
|||
const char *BufferStart; // Start of the buffer.
|
||||
const char *BufferEnd; // End of the buffer.
|
||||
|
||||
|
||||
protected:
|
||||
MemoryBuffer() = default;
|
||||
|
||||
|
@ -148,9 +147,6 @@ public:
|
|||
virtual BufferKind getBufferKind() const = 0;
|
||||
|
||||
MemoryBufferRef getMemBufferRef() const;
|
||||
|
||||
private:
|
||||
virtual void anchor();
|
||||
};
|
||||
|
||||
/// This class is an extension of MemoryBuffer, which allows copy-on-write
|
||||
|
|
|
@ -49,6 +49,9 @@ public:
|
|||
init(this->SV.begin(), this->SV.end(), false);
|
||||
}
|
||||
|
||||
// Key function.
|
||||
~SmallVectorMemoryBuffer() override;
|
||||
|
||||
StringRef getBufferIdentifier() const override { return BufferName; }
|
||||
|
||||
BufferKind getBufferKind() const override { return MemoryBuffer_Malloc; }
|
||||
|
@ -56,7 +59,6 @@ public:
|
|||
private:
|
||||
SmallVector<char, 0> SV;
|
||||
std::string BufferName;
|
||||
void anchor() override;
|
||||
};
|
||||
|
||||
} // namespace llvm
|
||||
|
|
|
@ -533,5 +533,4 @@ MemoryBufferRef MemoryBuffer::getMemBufferRef() const {
|
|||
return MemoryBufferRef(Data, Identifier);
|
||||
}
|
||||
|
||||
void MemoryBuffer::anchor() {}
|
||||
void SmallVectorMemoryBuffer::anchor() {}
|
||||
SmallVectorMemoryBuffer::~SmallVectorMemoryBuffer() {}
|
||||
|
|
Loading…
Reference in New Issue