aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-06-29 18:25:52 +0000
committerDan Gohman <gohman@apple.com>2009-06-29 18:25:52 +0000
commit3bf01f0569aa24a038c6e479cf495c0c1e2c0802 (patch)
tree4b7d7c3dce0282c4c668b100a2b9cb5a87442684 /lib/Analysis
parent58155b2f892b087c62cf123e967b47733c89c5a6 (diff)
downloadexternal_llvm-3bf01f0569aa24a038c6e479cf495c0c1e2c0802.zip
external_llvm-3bf01f0569aa24a038c6e479cf495c0c1e2c0802.tar.gz
external_llvm-3bf01f0569aa24a038c6e479cf495c0c1e2c0802.tar.bz2
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
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index f4210e7..6e32dcd 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -1048,9 +1048,8 @@ CollectAddOperandsWithScales(DenseMap<const SCEV*, APInt> &M,
SmallVector<const SCEV*, 4> MulOps(Mul->op_begin()+1, Mul->op_end());
const SCEV* Key = SE.getMulExpr(MulOps);
std::pair<DenseMap<const SCEV*, APInt>::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<const SCEV*, APInt> &M,
} else {
// An ordinary operand. Update the map.
std::pair<DenseMap<const SCEV*, APInt>::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;