[llvm] r302464 - [PartialInlining] Capture by reference rather than by value.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 13:44:01 PDT 2017


Author: davide
Date: Mon May  8 15:44:01 2017
New Revision: 302464

URL: http://llvm.org/viewvc/llvm-project?rev=302464&view=rev
Log:
[PartialInlining] Capture by reference rather than by value.

Modified:
    llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp

Modified: llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp?rev=302464&r1=302463&r2=302464&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp Mon May  8 15:44:01 2017
@@ -157,7 +157,7 @@ PartialInlinerImpl::computeOutliningInfo
     return isa<ReturnInst>(TI);
   };
 
-  auto GetReturnBlock = [=](BasicBlock *Succ1, BasicBlock *Succ2) {
+  auto GetReturnBlock = [&](BasicBlock *Succ1, BasicBlock *Succ2) {
     if (IsReturnBlock(Succ1))
       return std::make_tuple(Succ1, Succ2);
     if (IsReturnBlock(Succ2))
@@ -167,7 +167,7 @@ PartialInlinerImpl::computeOutliningInfo
   };
 
   // Detect a triangular shape:
-  auto GetCommonSucc = [=](BasicBlock *Succ1, BasicBlock *Succ2) {
+  auto GetCommonSucc = [&](BasicBlock *Succ1, BasicBlock *Succ2) {
     if (IsSuccessor(Succ1, Succ2))
       return std::make_tuple(Succ1, Succ2);
     if (IsSuccessor(Succ2, Succ1))
@@ -423,7 +423,7 @@ Function *PartialInlinerImpl::unswitchFu
 
   // Returns true if the block is to be partial inlined into the caller
   // (i.e. not to be extracted to the out of line function)
-  auto ToBeInlined = [=](BasicBlock *BB) {
+  auto ToBeInlined = [&](BasicBlock *BB) {
     return BB == NewReturnBlock || NewEntries.count(BB);
   };
   // Gather up the blocks that we're going to extract.




More information about the llvm-commits mailing list