Opt: Remove unused lambda captures

Those are reported as errors by clang 5.0.0, due to the flags -Werror
and -Wunused-lambda-capture.
This commit is contained in:
Pierre Moreau 2017-11-30 22:32:44 +01:00 committed by Lei Zhang
parent 137953538a
commit 69043963e4
3 changed files with 5 additions and 6 deletions

View File

@ -651,7 +651,7 @@ void InlinePass::InitializeInline(ir::IRContext* c) {
InitializeProcessing(c);
// Don't bother updating the DefUseManger
update_def_use_mgr_ = [this](ir::Instruction&, bool) {};
update_def_use_mgr_ = [](ir::Instruction&, bool) {};
false_id_ = 0;

View File

@ -125,7 +125,7 @@ void LocalSingleStoreElimPass::CalculateImmediateDominators(
successors_map_.clear();
for (auto& blk : *func) {
ordered_blocks.push_back(&blk);
blk.ForEachSuccessorLabel([&blk, &ordered_blocks, this](uint32_t sbid) {
blk.ForEachSuccessorLabel([&blk, this](uint32_t sbid) {
successors_map_[&blk].push_back(label2block_[sbid]);
predecessors_map_[label2block_[sbid]].push_back(&blk);
});

View File

@ -795,10 +795,9 @@ bool MemPass::RemoveUnreachableBlocks(ir::Function* func) {
// If the block is reachable and has Phi instructions, remove all
// operands from its Phi instructions that reference unreachable blocks.
// If the block has no Phi instructions, this is a no-op.
block.ForEachPhiInst(
[&block, &reachable_blocks, this](ir::Instruction* phi) {
RemovePhiOperands(phi, reachable_blocks);
});
block.ForEachPhiInst([&reachable_blocks, this](ir::Instruction* phi) {
RemovePhiOperands(phi, reachable_blocks);
});
}
// Erase unreachable blocks.