Skip to content

Commit 183b5d3

Browse files
committed
[demangle] Copy back some NFC commits from LLVM
1 parent b705fe5 commit 183b5d3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

libcxxabi/src/demangle/ItaniumDemangle.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,10 +2173,10 @@ class PODSmallVector {
21732173
static_assert(std::is_pod<T>::value,
21742174
"T is required to be a plain old data type");
21752175

2176-
T* First;
2177-
T* Last;
2178-
T* Cap;
2179-
T Inline[N];
2176+
T* First = nullptr;
2177+
T* Last = nullptr;
2178+
T* Cap = nullptr;
2179+
T Inline[N] = {0};
21802180

21812181
bool isInline() const { return First == Inline; }
21822182

libcxxabi/src/demangle/Utility.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ DEMANGLE_NAMESPACE_BEGIN
2525
// Stream that AST nodes write their string representation into after the AST
2626
// has been parsed.
2727
class OutputStream {
28-
char *Buffer;
29-
size_t CurrentPosition;
30-
size_t BufferCapacity;
28+
char *Buffer = nullptr;
29+
size_t CurrentPosition = 0;
30+
size_t BufferCapacity = 0;
3131

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

138138
char *getBuffer() { return Buffer; }
139139
char *getBufferEnd() { return Buffer + CurrentPosition - 1; }
140-
size_t getBufferCapacity() { return BufferCapacity; }
140+
size_t getBufferCapacity() const { return BufferCapacity; }
141141
};
142142

143143
template <class T> class SwapAndRestore {

0 commit comments

Comments
 (0)