From: Dan Gohman Date: Thu, 1 Jul 2010 01:33:21 +0000 (+0000) Subject: Don't use operator[] here, because it's not desirable to insert a default X-Git-Tag: android-x86-6.0-r1~1003^2~5166 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c25ad637662ec24880a7eadad69b1be311ea61ae;p=android-x86%2Fexternal-llvm.git Don't use operator[] here, because it's not desirable to insert a default value if the search fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107368 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 40995849238..8cf279a8acf 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -6127,8 +6127,11 @@ SelectionDAGBuilder::HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB) { } Reg = RegOut; } else { - Reg = FuncInfo.ValueMap[PHIOp]; - if (Reg == 0) { + DenseMap::iterator I = + FuncInfo.ValueMap.find(PHIOp); + if (I != FuncInfo.ValueMap.end()) + Reg = I->second; + else { assert(isa(PHIOp) && FuncInfo.StaticAllocaMap.count(cast(PHIOp)) && "Didn't codegen value into a register!??");