[PATCH] D40648: A few initializations to please Valgrind. NFC

Jesper Antonsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 02:12:16 PST 2017


JesperAntonsson updated this revision to Diff 126105.
JesperAntonsson added a comment.

Updated according to Bjorns suggestions: added TiedTo initializations and made bool args initialize to false instead of 0.


https://reviews.llvm.org/D40648

Files:
  include/llvm/CodeGen/MachineOperand.h
  lib/CodeGen/AsmPrinter/DwarfDebug.h
  lib/Transforms/Scalar/SROA.cpp


Index: lib/Transforms/Scalar/SROA.cpp
===================================================================
--- lib/Transforms/Scalar/SROA.cpp
+++ lib/Transforms/Scalar/SROA.cpp
@@ -1548,7 +1548,7 @@
   // never are able to compute one directly that has the correct type, we'll
   // fall back to it, so keep it and the base it was computed from around here.
   Value *OffsetPtr = nullptr;
-  Value *OffsetBasePtr;
+  Value *OffsetBasePtr = nullptr;
 
   // Remember any i8 pointer we come across to re-use if we need to do a raw
   // byte offset.
Index: lib/CodeGen/AsmPrinter/DwarfDebug.h
===================================================================
--- lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -226,7 +226,7 @@
   const MachineFunction *CurFn = nullptr;
 
   /// If nonnull, stores the CU in which the previous subprogram was contained.
-  const DwarfCompileUnit *PrevCU;
+  const DwarfCompileUnit *PrevCU = nullptr;
 
   /// As an optimization, there is no need to emit an entry in the directory
   /// table for the same directory as DW_AT_comp_dir.
Index: include/llvm/CodeGen/MachineOperand.h
===================================================================
--- include/llvm/CodeGen/MachineOperand.h
+++ include/llvm/CodeGen/MachineOperand.h
@@ -191,7 +191,10 @@
   } Contents;
 
   explicit MachineOperand(MachineOperandType K)
-    : OpKind(K), SubReg_TargetFlags(0), ParentMI(nullptr) {}
+    : OpKind(K), SubReg_TargetFlags(0), TiedTo(0),
+      IsDef(false), IsImp(false), IsKill(false), IsDead(false), IsUndef(false),
+      IsInternalRead(false), IsEarlyClobber(false), IsDebug(false),
+      ParentMI(nullptr) {}
 public:
   /// getType - Returns the MachineOperandType for this operand.
   ///


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40648.126105.patch
Type: text/x-patch
Size: 1757 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171208/72d2f607/attachment.bin>


More information about the llvm-commits mailing list