summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-11-08 14:27:51 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-11-08 14:46:23 +0000
commit43eeaa147f154b1e9bf241d34b14722a3b305f30 (patch)
tree18540d86f06c8394e5b41011e2febe629cbe6c63
parentc9021d749e2570ef43b8dc72e607d21ef756b455 (diff)
downloadbcm5719-llvm-43eeaa147f154b1e9bf241d34b14722a3b305f30.tar.gz
bcm5719-llvm-43eeaa147f154b1e9bf241d34b14722a3b305f30.zip
OutputStream - fix static analyzer warnings. NFCI.
- uninitialized variables - make getBufferCapacity() const
-rw-r--r--llvm/include/llvm/Demangle/Utility.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/include/llvm/Demangle/Utility.h b/llvm/include/llvm/Demangle/Utility.h
index ec23859af46..04e1936ebbe 100644
--- a/llvm/include/llvm/Demangle/Utility.h
+++ b/llvm/include/llvm/Demangle/Utility.h
@@ -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) {
@@ -137,7 +137,7 @@ public:
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 {
OpenPOWER on IntegriCloud