Coverage Report

Created: 2022-08-24 06:32

/src/solidity/libyul/optimiser/ConditionalUnsimplifier.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
  This file is part of solidity.
3
4
  solidity is free software: you can redistribute it and/or modify
5
  it under the terms of the GNU General Public License as published by
6
  the Free Software Foundation, either version 3 of the License, or
7
  (at your option) any later version.
8
9
  solidity is distributed in the hope that it will be useful,
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
  GNU General Public License for more details.
13
14
  You should have received a copy of the GNU General Public License
15
  along with solidity.  If not, see <http://www.gnu.org/licenses/>.
16
*/
17
// SPDX-License-Identifier: GPL-3.0
18
#pragma once
19
20
#include <libyul/optimiser/ASTWalker.h>
21
#include <libyul/optimiser/OptimiserStep.h>
22
#include <libyul/Dialect.h>
23
#include <libsolutil/Common.h>
24
25
namespace solidity::yul
26
{
27
28
/**
29
 * Reverse of conditional simplifier.
30
 *
31
 */
32
class ConditionalUnsimplifier: public ASTModifier
33
{
34
public:
35
  static constexpr char const* name{"ConditionalUnsimplifier"};
36
  static void run(OptimiserStepContext& _context, Block& _ast);
37
38
  using ASTModifier::operator();
39
  void operator()(Switch& _switch) override;
40
  void operator()(Block& _block) override;
41
42
private:
43
  explicit ConditionalUnsimplifier(
44
    Dialect const& _dialect,
45
    std::map<YulString, ControlFlowSideEffects> const& _sideEffects
46
  ):
47
    m_dialect(_dialect), m_functionSideEffects(_sideEffects)
48
0
  {}
49
  Dialect const& m_dialect;
50
  std::map<YulString, ControlFlowSideEffects> const& m_functionSideEffects;
51
};
52
53
}