From 23737e04235b6cab4c51546887397a9e53bf757c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 29 Jun 2009 18:25:52 +0000 Subject: [PATCH] Simplify this code, and avoid using APInt(). This fixes (otherwise harmless) uninitialized value warnings that Duncan found with gcc-4.4. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74437 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/ScalarEvolution.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index f4210e7b02e..6e32dcd51fb 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -1048,9 +1048,8 @@ CollectAddOperandsWithScales(DenseMap &M, SmallVector MulOps(Mul->op_begin()+1, Mul->op_end()); const SCEV* Key = SE.getMulExpr(MulOps); std::pair::iterator, bool> Pair = - M.insert(std::make_pair(Key, APInt())); + M.insert(std::make_pair(Key, NewScale)); if (Pair.second) { - Pair.first->second = NewScale; NewOps.push_back(Pair.first->first); } else { Pair.first->second += NewScale; @@ -1067,9 +1066,8 @@ CollectAddOperandsWithScales(DenseMap &M, } else { // An ordinary operand. Update the map. std::pair::iterator, bool> Pair = - M.insert(std::make_pair(Ops[i], APInt())); + M.insert(std::make_pair(Ops[i], Scale)); if (Pair.second) { - Pair.first->second = Scale; NewOps.push_back(Pair.first->first); } else { Pair.first->second += Scale;