[llvm] r249776 - [RS4GC] Don't copy ADT's unneccessarily, NFCI

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 16:18:22 PDT 2015


Author: sanjoy
Date: Thu Oct  8 18:18:22 2015
New Revision: 249776

URL: http://llvm.org/viewvc/llvm-project?rev=249776&view=rev
Log:
[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

Modified:
    llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=249776&r1=249775&r2=249776&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Thu Oct  8 18:18:22 2015
@@ -1501,8 +1501,8 @@ static void StabilizeOrder(SmallVectorIm
 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<Value *, 64> BaseVec, LiveVec;
@@ -1511,7 +1511,7 @@ makeStatepointExplicit(DominatorTree &DT
   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());




More information about the llvm-commits mailing list