From 98ed7d037b67d7b511d5a024634b7d7982406fb7 Mon Sep 17 00:00:00 2001 From: Eric Schweitz Date: Fri, 5 Oct 2018 11:10:47 -0700 Subject: [PATCH] [flang] Use move semantics directly to move the LoopControl object. Original-commit: flang-compiler/f18@7d646b42bb99e0f1534fd84fcc1b639256207e75 Reviewed-on: https://github.com/flang-compiler/f18/pull/203 Tree-same-pre-rewrite: false --- flang/lib/semantics/canonicalize-do.cc | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/flang/lib/semantics/canonicalize-do.cc b/flang/lib/semantics/canonicalize-do.cc index 80cd6f0..46bc2a5 100644 --- a/flang/lib/semantics/canonicalize-do.cc +++ b/flang/lib/semantics/canonicalize-do.cc @@ -28,7 +28,6 @@ public: : labelInfos_{labelInfos} {} template bool Pre(T &) { return true; } template void Post(T &) {} - bool Pre(ExecutionPart &executionPart) { return VisitBlock(executionPart.v); } bool Pre(Block &block) { return VisitBlock(block); } template bool Pre(Statement &statement) { if (!labelInfos_.empty() && statement.label.has_value() && @@ -80,24 +79,16 @@ private: block.splice(block.begin(), currentBlock, ++beginLoop, ++endLoop); return block; } - static std::optional ExtractLoopControl( - const Block::iterator &startLoop) { - return [](std::optional &loopControlOpt) { - return loopControlOpt.has_value() - ? std::optional{LoopControl{loopControlOpt->u}} - : std::optional{}; - }(std::get>( - std::get>>( - std::get(startLoop->u).u) - .statement->t)); - } static Block::iterator MakeCanonicalForm(Block ¤tBlock, const Block::iterator &startLoop, const Block::iterator &endLoop) { std::get(startLoop->u).u = common::Indirection{std::make_tuple( Statement{std::optional