diff options
| author | Jessica Paquette <jpaquette@apple.com> | 2018-12-05 22:47:25 +0000 |
|---|---|---|
| committer | Jessica Paquette <jpaquette@apple.com> | 2018-12-05 22:47:25 +0000 |
| commit | d9d9309bd48c5d6a670f0625b523cef7df3d5df5 (patch) | |
| tree | 0c8fd2917af231ee5ff3bb777a1d9a9cb1b53ee9 /llvm/lib | |
| parent | 235d877eea0bfb137db3be2edfb7b25c3110ccda (diff) | |
| download | bcm5719-llvm-d9d9309bd48c5d6a670f0625b523cef7df3d5df5.tar.gz bcm5719-llvm-d9d9309bd48c5d6a670f0625b523cef7df3d5df5.zip | |
Fix buildbot capture warning
A bot didn't like my lambda. This ought to fix it.
Example:
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/30139/steps/build%20lld/logs/stdio
error C3493: 'AlreadyRemoved' cannot be implicitly captured because no default
capture mode has been specified
llvm-svn: 348421
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/MachineOutliner.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp index 3b0a0ab6510..15926f85a38 100644 --- a/llvm/lib/CodeGen/MachineOutliner.cpp +++ b/llvm/lib/CodeGen/MachineOutliner.cpp @@ -1264,10 +1264,6 @@ bool MachineOutliner::outline( // Number to append to the current outlined function. unsigned OutlinedFunctionNum = 0; - // If something was already removed, its entry in the UnsignedVec will be - // this. - const unsigned AlreadyRemoved = static_cast<unsigned>(-1); - // Sort by benefit. The most beneficial functions should be outlined first. std::stable_sort( FunctionList.begin(), FunctionList.end(), @@ -1281,9 +1277,10 @@ bool MachineOutliner::outline( // If we outlined something that overlapped with a candidate in a previous // step, then we can't outline from it. erase_if(OF.Candidates, [&Mapper](std::shared_ptr<Candidate> &C) { - return std::any_of(Mapper.UnsignedVec.begin() + C->getStartIdx(), - Mapper.UnsignedVec.begin() + C->getEndIdx() + 1, - [](unsigned I) { return (I == AlreadyRemoved); }); + return std::any_of( + Mapper.UnsignedVec.begin() + C->getStartIdx(), + Mapper.UnsignedVec.begin() + C->getEndIdx() + 1, + [](unsigned I) { return (I == static_cast<unsigned>(-1)); }); }); // If we made it unbeneficial to outline this function, skip it. @@ -1344,10 +1341,10 @@ bool MachineOutliner::outline( // Erase needs one past the end, so we need std::next there too. MBB.erase(std::next(StartIt), std::next(EndIt)); - // Keep track of what we removed. + // Keep track of what we removed by marking them all as -1. std::for_each(Mapper.UnsignedVec.begin() + C.getStartIdx(), Mapper.UnsignedVec.begin() + C.getEndIdx() + 1, - [](unsigned &I) { I = AlreadyRemoved; }); + [](unsigned &I) { I = static_cast<unsigned>(-1); }); OutlinedSomething = true; // Statistics. |

