Null initialize a few variables flagged by
authorTed Kremenek <kremenek@apple.com>
Sun, 23 Jan 2011 17:05:06 +0000 (17:05 +0000)
committerTed Kremenek <kremenek@apple.com>
Sun, 23 Jan 2011 17:05:06 +0000 (17:05 +0000)
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124073 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ProfileInfo.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/Support/APFloat.cpp
lib/Target/ARM/ARMExpandPseudoInsts.cpp
lib/Target/CellSPU/SPUISelDAGToDAG.cpp
lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
lib/Transforms/InstCombine/InstCombineShifts.cpp

index 51dee2d13f06dd3d9b0c62781efa00a2d7946fc3..36f211e858d2325c0c9b1b28d3eb90cd911097ec 100644 (file)
@@ -889,7 +889,7 @@ void ProfileInfoT<Function,BasicBlock>::repair(const Function *F) {
     FI = Unvisited.begin(), FE = Unvisited.end();
     while(FI != FE && !FoundPath) {
       const BasicBlock *BB = *FI; ++FI;
     FI = Unvisited.begin(), FE = Unvisited.end();
     while(FI != FE && !FoundPath) {
       const BasicBlock *BB = *FI; ++FI;
-      const BasicBlock *Dest;
+      const BasicBlock *Dest = 0;
       Path P;
       bool BackEdgeFound = false;
       for (const_pred_iterator NBB = pred_begin(BB), End = pred_end(BB);
       Path P;
       bool BackEdgeFound = false;
       for (const_pred_iterator NBB = pred_begin(BB), End = pred_end(BB);
index 89b1e9b0b5ee12b94b91fd87e5ed9ffa7277a060..f6aea1f7956e0a7bc0ee5a77f1547abf0653fe9f 100644 (file)
@@ -4931,7 +4931,7 @@ SelectionDAG::getMachineNode(unsigned Opcode, DebugLoc DL, SDVTList VTs,
                              const SDValue *Ops, unsigned NumOps) {
   bool DoCSE = VTs.VTs[VTs.NumVTs-1] != MVT::Glue;
   MachineSDNode *N;
                              const SDValue *Ops, unsigned NumOps) {
   bool DoCSE = VTs.VTs[VTs.NumVTs-1] != MVT::Glue;
   MachineSDNode *N;
-  void *IP;
+  void *IP = 0;
 
   if (DoCSE) {
     FoldingSetNodeID ID;
 
   if (DoCSE) {
     FoldingSetNodeID ID;
index 0048ce57c2e255d759280c670922888c0faf157b..6d018afa3f63422c69e7d02d5894deb94cffd8f6 100644 (file)
@@ -175,7 +175,7 @@ totalExponent(StringRef::iterator p, StringRef::iterator end,
 {
   int unsignedExponent;
   bool negative, overflow;
 {
   int unsignedExponent;
   bool negative, overflow;
-  int exponent;
+  int exponent = 0;
 
   assert(p != end && "Exponent has no digits");
 
 
   assert(p != end && "Exponent has no digits");
 
index 4191d68728458ef6d9eb739bb05e416f246006d5..7e9d2179f7706a96524dae56c92b3746691ec273 100644 (file)
@@ -518,7 +518,7 @@ void ARMExpandPseudo::ExpandLaneOp(MachineBasicBlock::iterator &MBBI) {
   }
   assert(Lane < RegElts && "out of range lane for VLD/VST-lane");
 
   }
   assert(Lane < RegElts && "out of range lane for VLD/VST-lane");
 
-  unsigned D0, D1, D2, D3;
+  unsigned D0 = 0, D1 = 0, D2 = 0, D3 = 0;
   unsigned DstReg = 0;
   bool DstIsDead = false;
   if (TableEntry->IsLoad) {
   unsigned DstReg = 0;
   bool DstIsDead = false;
   if (TableEntry->IsLoad) {
index 7b4d8ccb5afea84c2d5e4274407138da1c271a70..d2261562e721bb14eec0a29e6ba377b491a0a08d 100644 (file)
@@ -612,7 +612,7 @@ SDNode *
 SPUDAGToDAGISel::Select(SDNode *N) {
   unsigned Opc = N->getOpcode();
   int n_ops = -1;
 SPUDAGToDAGISel::Select(SDNode *N) {
   unsigned Opc = N->getOpcode();
   int n_ops = -1;
-  unsigned NewOpc;
+  unsigned NewOpc = 0;
   EVT OpVT = N->getValueType(0);
   SDValue Ops[8];
   DebugLoc dl = N->getDebugLoc();
   EVT OpVT = N->getValueType(0);
   SDValue Ops[8];
   DebugLoc dl = N->getDebugLoc();
index 0af510c4cec74f1048652a7a64e25ad5795244b4..7b17f1e5a3a915bff3c65e651b12eb457efaa662 100644 (file)
@@ -290,7 +290,7 @@ static int readPrefixes(struct InternalInstruction* insn) {
   BOOL isPrefix = TRUE;
   BOOL prefixGroups[4] = { FALSE };
   uint64_t prefixLocation;
   BOOL isPrefix = TRUE;
   BOOL prefixGroups[4] = { FALSE };
   uint64_t prefixLocation;
-  uint8_t byte;
+  uint8_t byte = 0;
   
   BOOL hasAdSize = FALSE;
   BOOL hasOpSize = FALSE;
   
   BOOL hasAdSize = FALSE;
   BOOL hasOpSize = FALSE;
index fe791ddaf7b0c56e19e68671c8f8b1b377244d7b..988f29e16a42db0907da13523ab835a4d3c985bc 100644 (file)
@@ -76,7 +76,7 @@ static bool CanEvaluateShifted(Value *V, unsigned NumBits, bool isLeftShift,
   // if the needed bits are already zero in the input.  This allows us to reuse
   // the value which means that we don't care if the shift has multiple uses.
   //  TODO:  Handle opposite shift by exact value.
   // if the needed bits are already zero in the input.  This allows us to reuse
   // the value which means that we don't care if the shift has multiple uses.
   //  TODO:  Handle opposite shift by exact value.
-  ConstantInt *CI;
+  ConstantInt *CI = 0;
   if ((isLeftShift && match(I, m_LShr(m_Value(), m_ConstantInt(CI)))) ||
       (!isLeftShift && match(I, m_Shl(m_Value(), m_ConstantInt(CI))))) {
     if (CI->getZExtValue() == NumBits) {
   if ((isLeftShift && match(I, m_LShr(m_Value(), m_ConstantInt(CI)))) ||
       (!isLeftShift && match(I, m_Shl(m_Value(), m_ConstantInt(CI))))) {
     if (CI->getZExtValue() == NumBits) {