Skip to content

Commit

Permalink
OutputStream - fix static analyzer warnings. NFCI.
Browse files Browse the repository at this point in the history
 - uninitialized variables
 - make getBufferCapacity() const
  • Loading branch information
RKSimon committed Nov 8, 2019
1 parent c9021d7 commit 43eeaa1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llvm/include/llvm/Demangle/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ DEMANGLE_NAMESPACE_BEGIN
// Stream that AST nodes write their string representation into after the AST
// has been parsed.
class OutputStream {
char *Buffer;
size_t CurrentPosition;
size_t BufferCapacity;
char *Buffer = nullptr;
size_t CurrentPosition = 0;
size_t BufferCapacity = 0;

// Ensure there is at least n more positions in buffer.
void grow(size_t N) {
Expand Down Expand Up @@ -137,7 +137,7 @@ class OutputStream {

char *getBuffer() { return Buffer; }
char *getBufferEnd() { return Buffer + CurrentPosition - 1; }
size_t getBufferCapacity() { return BufferCapacity; }
size_t getBufferCapacity() const { return BufferCapacity; }
};

template <class T> class SwapAndRestore {
Expand Down

0 comments on commit 43eeaa1

Please sign in to comment.