Coverage Report

Created: 2026-08-14 07:35

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/solidity/libsolidity/ast/CallGraph.cpp
Line
Count
Source
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
19
#include <libsolidity/ast/CallGraph.h>
20
21
using namespace solidity::frontend;
22
23
bool CallGraph::CompareByID::operator()(Node const& _lhs, Node const& _rhs) const
24
360k
{
25
360k
  if (_lhs.index() != _rhs.index())
26
76.5k
    return _lhs.index() < _rhs.index();
27
28
283k
  if (std::holds_alternative<SpecialNode>(_lhs))
29
43.1k
    return std::get<SpecialNode>(_lhs) < std::get<SpecialNode>(_rhs);
30
240k
  return std::get<CallableDeclaration const*>(_lhs)->id() < std::get<CallableDeclaration const*>(_rhs)->id();
31
283k
}
32
33
bool CallGraph::CompareByID::operator()(Node const& _lhs, int64_t _rhs) const
34
0
{
35
0
  solAssert(!std::holds_alternative<SpecialNode>(_lhs), "");
36
37
0
  return std::get<CallableDeclaration const*>(_lhs)->id() < _rhs;
38
0
}
39
40
bool CallGraph::CompareByID::operator()(int64_t _lhs, Node const& _rhs) const
41
0
{
42
0
  solAssert(!std::holds_alternative<SpecialNode>(_rhs), "");
43
44
0
  return _lhs < std::get<CallableDeclaration const*>(_rhs)->id();
45
0
}