[ValueLattice] Fix uninitialized-value after D79036
authorFangrui Song <maskray@google.com>
Sat, 30 May 2020 02:48:33 +0000 (19:48 -0700)
committerFangrui Song <maskray@google.com>
Sat, 30 May 2020 02:52:29 +0000 (19:52 -0700)
Many check-clang-codegen tests failed.

llvm/include/llvm/Analysis/ValueLattice.h

index 00a230f..bf5bab9 100644 (file)
@@ -142,11 +142,12 @@ public:
   };
 
   // ConstVal and Range are initialized on-demand.
-  ValueLatticeElement() : Tag(unknown) {}
+  ValueLatticeElement() : Tag(unknown), NumRangeExtensions(0) {}
 
   ~ValueLatticeElement() { destroy(); }
 
-  ValueLatticeElement(const ValueLatticeElement &Other) : Tag(Other.Tag) {
+  ValueLatticeElement(const ValueLatticeElement &Other)
+      : Tag(Other.Tag), NumRangeExtensions(0) {
     switch (Other.Tag) {
     case constantrange:
     case constantrange_including_undef:
@@ -164,7 +165,8 @@ public:
     }
   }
 
-  ValueLatticeElement(ValueLatticeElement &&Other) : Tag(Other.Tag) {
+  ValueLatticeElement(ValueLatticeElement &&Other)
+      : Tag(Other.Tag), NumRangeExtensions(0) {
     switch (Other.Tag) {
     case constantrange:
     case constantrange_including_undef: