[libcxx-commits] [libcxxabi] 183b5d3 - [demangle] Copy back some NFC commits from LLVM

Erik Pilkington via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 9 10:34:06 PST 2020


Author: Erik Pilkington
Date: 2020-01-09T10:27:24-08:00
New Revision: 183b5d38d7cffc10ff9f4914b8879ed5b1976e40

URL: https://github.com/llvm/llvm-project/commit/183b5d38d7cffc10ff9f4914b8879ed5b1976e40
DIFF: https://github.com/llvm/llvm-project/commit/183b5d38d7cffc10ff9f4914b8879ed5b1976e40.diff

LOG: [demangle] Copy back some NFC commits from LLVM

Added: 
    

Modified: 
    libcxxabi/src/demangle/ItaniumDemangle.h
    libcxxabi/src/demangle/Utility.h

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h
index 59eca7a67054..376e0efea423 100644
--- a/libcxxabi/src/demangle/ItaniumDemangle.h
+++ b/libcxxabi/src/demangle/ItaniumDemangle.h
@@ -2173,10 +2173,10 @@ class PODSmallVector {
   static_assert(std::is_pod<T>::value,
                 "T is required to be a plain old data type");
 
-  T* First;
-  T* Last;
-  T* Cap;
-  T Inline[N];
+  T* First = nullptr;
+  T* Last = nullptr;
+  T* Cap = nullptr;
+  T Inline[N] = {0};
 
   bool isInline() const { return First == Inline; }
 

diff  --git a/libcxxabi/src/demangle/Utility.h b/libcxxabi/src/demangle/Utility.h
index ec23859af46a..04e1936ebbe7 100644
--- a/libcxxabi/src/demangle/Utility.h
+++ b/libcxxabi/src/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 @@ 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 {


        


More information about the libcxx-commits mailing list