From: Sanjoy Das Date: Thu, 8 Oct 2015 23:18:22 +0000 (+0000) Subject: [RS4GC] Don't copy ADT's unneccessarily, NFCI X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=33e26625967492a0c0a4d51a9913b4d45257d1b6;p=oota-llvm.git [RS4GC] Don't copy ADT's unneccessarily, NFCI Summary: Use `const auto &` instead of `auto` in `makeStatepointExplicit`. Reviewers: reames, swaroop.sridhar Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13454 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249776 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 53cf3564015..ed097003e31 100644 --- a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -1501,8 +1501,8 @@ static void StabilizeOrder(SmallVectorImpl &BaseVec, static void makeStatepointExplicit(DominatorTree &DT, const CallSite &CS, PartiallyConstructedSafepointRecord &Result) { - auto LiveSet = Result.LiveSet; - auto PointerToBase = Result.PointerToBase; + const auto &LiveSet = Result.LiveSet; + const auto &PointerToBase = Result.PointerToBase; // Convert to vector for efficient cross referencing. SmallVector BaseVec, LiveVec; @@ -1511,7 +1511,7 @@ makeStatepointExplicit(DominatorTree &DT, const CallSite &CS, for (Value *L : LiveSet) { LiveVec.push_back(L); assert(PointerToBase.count(L)); - Value *Base = PointerToBase[L]; + Value *Base = PointerToBase.find(L)->second; BaseVec.push_back(Base); } assert(LiveVec.size() == BaseVec.size());