LCOV - code coverage report
Current view: top level - gcc/rust/hir/tree - rust-hir-visitor.cc (source / functions) Coverage Total Hit
Test: gcc.info Lines: 75.4 % 737 556
Test Date: 2025-11-22 14:42:49 Functions: 74.8 % 143 107
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : // Copyright (C) 2021-2025 Free Software Foundation, Inc.
       2                 :             : 
       3                 :             : // This file is part of GCC.
       4                 :             : 
       5                 :             : // GCC is free software; you can redistribute it and/or modify it under
       6                 :             : // the terms of the GNU General Public License as published by the Free
       7                 :             : // Software Foundation; either version 3, or (at your option) any later
       8                 :             : // version.
       9                 :             : 
      10                 :             : // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
      11                 :             : // WARRANTY; without even the implied warranty of MERCHANTABILITY or
      12                 :             : // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      13                 :             : // for more details.
      14                 :             : 
      15                 :             : // You should have received a copy of the GNU General Public License
      16                 :             : // along with GCC; see the file COPYING3.  If not see
      17                 :             : // <http://www.gnu.org/licenses/>.
      18                 :             : 
      19                 :             : #include "rust-expr.h"
      20                 :             : #include "rust-hir-full-decls.h"
      21                 :             : #include "rust-hir-visitor.h"
      22                 :             : #include "rust-hir-full.h"
      23                 :             : #include "rust-system.h"
      24                 :             : 
      25                 :             : namespace Rust {
      26                 :             : namespace HIR {
      27                 :             : 
      28                 :             : void
      29                 :        5812 : DefaultHIRVisitor::walk (Lifetime &)
      30                 :        5812 : {}
      31                 :             : 
      32                 :             : void
      33                 :         163 : DefaultHIRVisitor::walk (LifetimeParam &lifetime_param)
      34                 :             : {
      35                 :         163 :   visit_outer_attrs (lifetime_param);
      36                 :         163 :   lifetime_param.get_lifetime ().accept_vis (*this);
      37                 :         163 :   for (Lifetime &lifetime_bound : lifetime_param.get_lifetime_bounds ())
      38                 :           0 :     lifetime_bound.accept_vis (*this);
      39                 :         163 : }
      40                 :             : 
      41                 :             : void
      42                 :        2268 : DefaultHIRVisitor::visit_generic_args (GenericArgs &generic_args)
      43                 :             : {
      44                 :        2287 :   for (auto &lifetime : generic_args.get_lifetime_args ())
      45                 :          19 :     lifetime.accept_vis (*this);
      46                 :        4642 :   for (auto &type : generic_args.get_type_args ())
      47                 :        2374 :     type->accept_vis (*this);
      48                 :        2308 :   for (auto &binding : generic_args.get_binding_args ())
      49                 :          40 :     binding.get_type ().accept_vis (*this);
      50                 :        2304 :   for (auto &const_arg : generic_args.get_const_args ())
      51                 :          36 :     const_arg.get_expression ()->accept_vis (*this);
      52                 :        2268 : }
      53                 :             : 
      54                 :             : void
      55                 :           0 : DefaultHIRVisitor::walk (PathInExpression &path_in_expr)
      56                 :             : {
      57                 :           0 :   visit_outer_attrs (path_in_expr);
      58                 :           0 :   if (!path_in_expr.is_lang_item ())
      59                 :           0 :     for (auto &segment : path_in_expr.get_segments ())
      60                 :           0 :       visit_path_expr_segment (segment);
      61                 :           0 : }
      62                 :             : 
      63                 :             : void
      64                 :       44748 : DefaultHIRVisitor::walk (TypePathSegment &)
      65                 :       44748 : {}
      66                 :             : 
      67                 :             : void
      68                 :          27 : DefaultHIRVisitor::walk (TypePathSegmentFunction &segment_function)
      69                 :             : {
      70                 :          27 :   TypePathFunction &function_path = segment_function.get_function_path ();
      71                 :          27 :   if (function_path.has_inputs ())
      72                 :          56 :     for (auto &param : function_path.get_params ())
      73                 :          29 :       param->accept_vis (*this);
      74                 :          27 :   if (function_path.has_return_type ())
      75                 :          27 :     function_path.get_return_type ().accept_vis (*this);
      76                 :          27 : }
      77                 :             : 
      78                 :             : void
      79                 :        2268 : DefaultHIRVisitor::walk (TypePathSegmentGeneric &segment_generic)
      80                 :             : {
      81                 :        2268 :   if (segment_generic.has_generic_args ())
      82                 :        2268 :     visit_generic_args (segment_generic.get_generic_args ());
      83                 :        2268 : }
      84                 :             : 
      85                 :             : void
      86                 :       45096 : DefaultHIRVisitor::walk (TypePath &type_path)
      87                 :             : {
      88                 :       91947 :   for (auto &segment : type_path.get_segments ())
      89                 :       46851 :     segment->accept_vis (*this);
      90                 :       45096 : }
      91                 :             : 
      92                 :             : void
      93                 :         264 : DefaultHIRVisitor::visit_qualified_path_type (QualifiedPathType &path)
      94                 :             : {
      95                 :         264 :   path.get_type ().accept_vis (*this);
      96                 :         264 :   if (path.has_as_clause ())
      97                 :         232 :     path.get_trait ().accept_vis (*this);
      98                 :         264 : }
      99                 :             : 
     100                 :             : // TODO: Implement visit_path_expr_segment
     101                 :             : void
     102                 :        1402 : DefaultHIRVisitor::visit_path_expr_segment (PathExprSegment &segment)
     103                 :             : {
     104                 :        1402 :   if (segment.has_generic_args ())
     105                 :           0 :     visit_generic_args (segment.get_generic_args ());
     106                 :        1402 : }
     107                 :             : 
     108                 :             : void
     109                 :          72 : DefaultHIRVisitor::walk (QualifiedPathInExpression &path_in_expr)
     110                 :             : {
     111                 :          72 :   visit_outer_attrs (path_in_expr);
     112                 :          72 :   visit_qualified_path_type (path_in_expr.get_path_type ());
     113                 :         144 :   for (auto &segment : path_in_expr.get_segments ())
     114                 :          72 :     visit_path_expr_segment (segment);
     115                 :          72 : }
     116                 :             : 
     117                 :             : void
     118                 :         192 : DefaultHIRVisitor::walk (QualifiedPathInType &path_in_type)
     119                 :             : {
     120                 :         192 :   visit_qualified_path_type (path_in_type.get_path_type ());
     121                 :         192 :   path_in_type.get_associated_segment ().accept_vis (*this);
     122                 :         192 :   for (auto &segment : path_in_type.get_segments ())
     123                 :           0 :     segment->accept_vis (*this);
     124                 :         192 : }
     125                 :             : 
     126                 :             : void
     127                 :           0 : DefaultHIRVisitor::walk (LiteralExpr &expr)
     128                 :             : {
     129                 :           0 :   visit_outer_attrs (expr);
     130                 :           0 : }
     131                 :             : 
     132                 :             : void
     133                 :        1202 : DefaultHIRVisitor::walk (BorrowExpr &expr)
     134                 :             : {
     135                 :        1202 :   visit_outer_attrs (expr);
     136                 :        1202 :   expr.get_expr ().accept_vis (*this);
     137                 :        1202 : }
     138                 :             : 
     139                 :             : void
     140                 :           0 : DefaultHIRVisitor::walk (DereferenceExpr &expr)
     141                 :             : {
     142                 :           0 :   visit_outer_attrs (expr);
     143                 :           0 :   expr.get_expr ().accept_vis (*this);
     144                 :           0 : }
     145                 :             : 
     146                 :             : void
     147                 :           0 : DefaultHIRVisitor::walk (ErrorPropagationExpr &expr)
     148                 :             : {
     149                 :           0 :   visit_outer_attrs (expr);
     150                 :           0 :   expr.get_expr ().accept_vis (*this);
     151                 :           0 : }
     152                 :             : 
     153                 :             : void
     154                 :         323 : DefaultHIRVisitor::walk (NegationExpr &expr)
     155                 :             : {
     156                 :         323 :   visit_outer_attrs (expr);
     157                 :         323 :   expr.get_expr ().accept_vis (*this);
     158                 :         323 : }
     159                 :             : 
     160                 :             : void
     161                 :        2144 : DefaultHIRVisitor::walk (ArithmeticOrLogicalExpr &expr)
     162                 :             : {
     163                 :        2144 :   visit_outer_attrs (expr);
     164                 :        2144 :   expr.get_lhs ().accept_vis (*this);
     165                 :        2144 :   expr.get_rhs ().accept_vis (*this);
     166                 :        2144 : }
     167                 :             : 
     168                 :             : void
     169                 :        2557 : DefaultHIRVisitor::walk (ComparisonExpr &expr)
     170                 :             : {
     171                 :        2557 :   visit_outer_attrs (expr);
     172                 :        2557 :   expr.get_lhs ().accept_vis (*this);
     173                 :        2557 :   expr.get_rhs ().accept_vis (*this);
     174                 :        2557 : }
     175                 :             : 
     176                 :             : void
     177                 :         335 : DefaultHIRVisitor::walk (LazyBooleanExpr &expr)
     178                 :             : {
     179                 :         335 :   visit_outer_attrs (expr);
     180                 :         335 :   expr.get_lhs ().accept_vis (*this);
     181                 :         335 :   expr.get_rhs ().accept_vis (*this);
     182                 :         335 : }
     183                 :             : 
     184                 :             : void
     185                 :        1953 : DefaultHIRVisitor::walk (TypeCastExpr &expr)
     186                 :             : {
     187                 :        1953 :   visit_outer_attrs (expr);
     188                 :        1953 :   expr.get_expr ().accept_vis (*this);
     189                 :        1953 :   expr.get_type_to_convert_to ().accept_vis (*this);
     190                 :        1953 : }
     191                 :             : 
     192                 :             : void
     193                 :           0 : DefaultHIRVisitor::walk (AssignmentExpr &expr)
     194                 :             : {
     195                 :           0 :   visit_outer_attrs (expr);
     196                 :           0 :   expr.get_lhs ().accept_vis (*this);
     197                 :           0 :   expr.get_rhs ().accept_vis (*this);
     198                 :           0 : }
     199                 :             : 
     200                 :             : void
     201                 :         645 : DefaultHIRVisitor::walk (CompoundAssignmentExpr &expr)
     202                 :             : {
     203                 :         645 :   visit_outer_attrs (expr);
     204                 :         645 :   expr.get_lhs ().accept_vis (*this);
     205                 :         645 :   expr.get_rhs ().accept_vis (*this);
     206                 :         645 : }
     207                 :             : 
     208                 :             : void
     209                 :         174 : DefaultHIRVisitor::walk (GroupedExpr &expr)
     210                 :             : {
     211                 :         174 :   visit_outer_attrs (expr);
     212                 :         174 :   visit_inner_attrs (expr);
     213                 :         174 :   expr.get_expr_in_parens ().accept_vis (*this);
     214                 :         174 : }
     215                 :             : 
     216                 :             : void
     217                 :          37 : DefaultHIRVisitor::walk (ArrayElemsValues &elems)
     218                 :             : {
     219                 :         246 :   for (auto &elem : elems.get_values ())
     220                 :         209 :     elem->accept_vis (*this);
     221                 :          37 : }
     222                 :             : 
     223                 :             : void
     224                 :          37 : DefaultHIRVisitor::walk (ArrayElemsCopied &elems)
     225                 :             : {
     226                 :          37 :   elems.get_elem_to_copy ().accept_vis (*this);
     227                 :          37 :   elems.get_num_copies_expr ().accept_vis (*this);
     228                 :          37 : }
     229                 :             : 
     230                 :             : void
     231                 :          74 : DefaultHIRVisitor::walk (ArrayExpr &expr)
     232                 :             : {
     233                 :          74 :   visit_outer_attrs (expr);
     234                 :          74 :   visit_inner_attrs (expr);
     235                 :          74 :   expr.get_internal_elements ().accept_vis (*this);
     236                 :          74 : }
     237                 :             : 
     238                 :             : void
     239                 :           0 : DefaultHIRVisitor::walk (ArrayIndexExpr &expr)
     240                 :             : {
     241                 :           0 :   visit_outer_attrs (expr);
     242                 :           0 :   expr.get_array_expr ().accept_vis (*this);
     243                 :           0 :   expr.get_index_expr ().accept_vis (*this);
     244                 :           0 : }
     245                 :             : 
     246                 :             : void
     247                 :           0 : DefaultHIRVisitor::walk (TupleExpr &expr)
     248                 :             : {
     249                 :           0 :   visit_outer_attrs (expr);
     250                 :           0 :   visit_inner_attrs (expr);
     251                 :           0 :   for (auto &elem : expr.get_tuple_elems ())
     252                 :           0 :     elem->accept_vis (*this);
     253                 :           0 : }
     254                 :             : 
     255                 :             : void
     256                 :           0 : DefaultHIRVisitor::walk (TupleIndexExpr &expr)
     257                 :             : {
     258                 :           0 :   visit_outer_attrs (expr);
     259                 :           0 :   expr.get_tuple_expr ().accept_vis (*this);
     260                 :           0 : }
     261                 :             : 
     262                 :             : void
     263                 :          10 : DefaultHIRVisitor::walk (StructExprStruct &expr)
     264                 :             : {
     265                 :          10 :   visit_outer_attrs (expr);
     266                 :          10 :   visit_inner_attrs (expr);
     267                 :          10 :   expr.get_struct_name ().accept_vis (*this);
     268                 :          10 : }
     269                 :             : 
     270                 :             : void
     271                 :          86 : DefaultHIRVisitor::walk (StructExprFieldIdentifier &)
     272                 :          86 : {}
     273                 :             : 
     274                 :             : void
     275                 :         284 : DefaultHIRVisitor::walk (StructExprFieldIdentifierValue &field)
     276                 :             : {
     277                 :         284 :   field.get_value ().accept_vis (*this);
     278                 :         284 : }
     279                 :             : 
     280                 :             : void
     281                 :           0 : DefaultHIRVisitor::walk (StructExprFieldIndexValue &field)
     282                 :             : {
     283                 :           0 :   field.get_value ().accept_vis (*this);
     284                 :           0 : }
     285                 :             : 
     286                 :             : void
     287                 :         188 : DefaultHIRVisitor::walk (StructExprStructFields &expr)
     288                 :             : {
     289                 :         188 :   visit_outer_attrs (expr);
     290                 :         188 :   visit_inner_attrs (expr);
     291                 :         188 :   expr.get_struct_name ().accept_vis (*this);
     292                 :         188 :   if (expr.has_struct_base ())
     293                 :             :     {
     294                 :           0 :       StructBase &base = expr.get_struct_base ();
     295                 :           0 :       base.get_base ().accept_vis (*this);
     296                 :             :     }
     297                 :         558 :   for (auto &field : expr.get_fields ())
     298                 :         370 :     field->accept_vis (*this);
     299                 :         188 : }
     300                 :             : 
     301                 :             : void
     302                 :           0 : DefaultHIRVisitor::walk (StructExprStructBase &expr)
     303                 :             : {
     304                 :           0 :   visit_outer_attrs (expr);
     305                 :           0 :   visit_inner_attrs (expr);
     306                 :           0 :   expr.get_struct_name ().accept_vis (*this);
     307                 :           0 :   StructBase &base = expr.get_struct_base ();
     308                 :           0 :   base.get_base ().accept_vis (*this);
     309                 :           0 : }
     310                 :             : 
     311                 :             : void
     312                 :        7629 : DefaultHIRVisitor::walk (CallExpr &expr)
     313                 :             : {
     314                 :        7629 :   visit_outer_attrs (expr);
     315                 :        7629 :   expr.get_fnexpr ().accept_vis (*this);
     316                 :       16925 :   for (auto &arg : expr.get_arguments ())
     317                 :        9296 :     arg->accept_vis (*this);
     318                 :        7629 : }
     319                 :             : 
     320                 :             : void
     321                 :        1330 : DefaultHIRVisitor::walk (MethodCallExpr &expr)
     322                 :             : {
     323                 :        1330 :   visit_outer_attrs (expr);
     324                 :        1330 :   expr.get_receiver ().accept_vis (*this);
     325                 :        1330 :   visit_path_expr_segment (expr.get_method_name ());
     326                 :        2196 :   for (auto &arg : expr.get_arguments ())
     327                 :         866 :     arg->accept_vis (*this);
     328                 :        1330 : }
     329                 :             : 
     330                 :             : void
     331                 :           0 : DefaultHIRVisitor::walk (FieldAccessExpr &expr)
     332                 :             : {
     333                 :           0 :   visit_outer_attrs (expr);
     334                 :           0 :   expr.get_receiver_expr ().accept_vis (*this);
     335                 :           0 : }
     336                 :             : 
     337                 :             : void
     338                 :           0 : DefaultHIRVisitor::visit_closure_param (ClosureParam &param)
     339                 :             : {
     340                 :           0 :   visit_outer_attrs (param);
     341                 :           0 :   param.get_pattern ().accept_vis (*this);
     342                 :           0 :   if (param.has_type_given ())
     343                 :             :     {
     344                 :           0 :       param.get_type ().accept_vis (*this);
     345                 :             :     }
     346                 :           0 : }
     347                 :             : 
     348                 :             : void
     349                 :           7 : DefaultHIRVisitor::walk (ClosureExpr &expr)
     350                 :             : {
     351                 :           7 :   visit_outer_attrs (expr);
     352                 :           7 :   for (auto &param : expr.get_params ())
     353                 :           0 :     visit_closure_param (param);
     354                 :           7 :   if (expr.has_return_type ())
     355                 :           0 :     expr.get_return_type ().accept_vis (*this);
     356                 :           7 :   expr.get_expr ().accept_vis (*this);
     357                 :           7 : }
     358                 :             : 
     359                 :             : void
     360                 :       20299 : DefaultHIRVisitor::walk (BlockExpr &expr)
     361                 :             : {
     362                 :       20299 :   visit_outer_attrs (expr);
     363                 :       20299 :   visit_inner_attrs (expr);
     364                 :       41685 :   for (auto &stmt : expr.get_statements ())
     365                 :       21386 :     stmt->accept_vis (*this);
     366                 :       20299 :   if (expr.has_expr ())
     367                 :       14869 :     expr.get_final_expr ().accept_vis (*this);
     368                 :       20299 : }
     369                 :             : 
     370                 :             : void
     371                 :         477 : DefaultHIRVisitor::walk (AnonConst &expr)
     372                 :             : {
     373                 :         477 :   if (!expr.is_deferred ())
     374                 :         477 :     expr.get_inner_expr ().accept_vis (*this);
     375                 :         477 : }
     376                 :             : 
     377                 :             : void
     378                 :           7 : DefaultHIRVisitor::walk (ConstBlock &expr)
     379                 :             : {
     380                 :           7 :   expr.get_const_expr ().accept_vis (*this);
     381                 :           7 : }
     382                 :             : 
     383                 :             : void
     384                 :           1 : DefaultHIRVisitor::walk (ContinueExpr &expr)
     385                 :             : {
     386                 :           1 :   visit_outer_attrs (expr);
     387                 :           1 :   if (expr.has_label ())
     388                 :           0 :     expr.get_label ().accept_vis (*this);
     389                 :           1 : }
     390                 :             : 
     391                 :             : void
     392                 :          43 : DefaultHIRVisitor::walk (BreakExpr &expr)
     393                 :             : {
     394                 :          43 :   visit_outer_attrs (expr);
     395                 :          43 :   if (expr.has_label ())
     396                 :          15 :     expr.get_label ().accept_vis (*this);
     397                 :             : 
     398                 :          43 :   if (expr.has_break_expr ())
     399                 :           0 :     expr.get_expr ().accept_vis (*this);
     400                 :          43 : }
     401                 :             : 
     402                 :             : void
     403                 :           0 : DefaultHIRVisitor::walk (RangeFromToExpr &expr)
     404                 :             : {
     405                 :           0 :   expr.get_from_expr ().accept_vis (*this);
     406                 :           0 :   expr.get_to_expr ().accept_vis (*this);
     407                 :           0 : }
     408                 :             : 
     409                 :             : void
     410                 :           0 : DefaultHIRVisitor::walk (RangeFromExpr &expr)
     411                 :             : {
     412                 :           0 :   expr.get_from_expr ().accept_vis (*this);
     413                 :           0 : }
     414                 :             : 
     415                 :             : void
     416                 :           0 : DefaultHIRVisitor::walk (RangeToExpr &expr)
     417                 :             : {
     418                 :           0 :   expr.get_to_expr ().accept_vis (*this);
     419                 :           0 : }
     420                 :             : 
     421                 :             : void
     422                 :           0 : DefaultHIRVisitor::walk (RangeFullExpr &)
     423                 :           0 : {}
     424                 :             : 
     425                 :             : void
     426                 :           0 : DefaultHIRVisitor::walk (RangeFromToInclExpr &expr)
     427                 :             : {
     428                 :           0 :   expr.get_from_expr ().accept_vis (*this);
     429                 :           0 :   expr.get_to_expr ().accept_vis (*this);
     430                 :           0 : }
     431                 :             : 
     432                 :             : void
     433                 :           0 : DefaultHIRVisitor::walk (RangeToInclExpr &expr)
     434                 :             : {
     435                 :           0 :   expr.get_to_expr ().accept_vis (*this);
     436                 :           0 : }
     437                 :             : 
     438                 :             : void
     439                 :         482 : DefaultHIRVisitor::walk (ReturnExpr &expr)
     440                 :             : {
     441                 :         482 :   visit_outer_attrs (expr);
     442                 :         482 :   if (expr.has_return_expr ())
     443                 :         454 :     expr.get_expr ().accept_vis (*this);
     444                 :         482 : }
     445                 :             : 
     446                 :             : void
     447                 :        3080 : DefaultHIRVisitor::walk (UnsafeBlockExpr &expr)
     448                 :             : {
     449                 :        3080 :   visit_outer_attrs (expr);
     450                 :        3080 :   expr.get_block_expr ().accept_vis (*this);
     451                 :        3080 : }
     452                 :             : 
     453                 :             : void
     454                 :          29 : DefaultHIRVisitor::visit_loop_label (LoopLabel &label)
     455                 :             : {
     456                 :          29 :   label.get_lifetime ().accept_vis (*this);
     457                 :          29 : }
     458                 :             : 
     459                 :             : void
     460                 :          70 : DefaultHIRVisitor::walk (LoopExpr &expr)
     461                 :             : {
     462                 :          70 :   visit_outer_attrs (expr);
     463                 :          70 :   if (expr.has_loop_label ())
     464                 :          28 :     visit_loop_label (expr.get_loop_label ());
     465                 :          70 :   expr.get_loop_block ().accept_vis (*this);
     466                 :          70 : }
     467                 :             : 
     468                 :             : void
     469                 :          65 : DefaultHIRVisitor::walk (WhileLoopExpr &expr)
     470                 :             : {
     471                 :          65 :   visit_outer_attrs (expr);
     472                 :          65 :   if (expr.has_loop_label ())
     473                 :           1 :     visit_loop_label (expr.get_loop_label ());
     474                 :          65 :   expr.get_predicate_expr ().accept_vis (*this);
     475                 :          65 :   expr.get_loop_block ().accept_vis (*this);
     476                 :          65 : }
     477                 :             : 
     478                 :             : void
     479                 :           0 : DefaultHIRVisitor::walk (WhileLetLoopExpr &expr)
     480                 :             : {
     481                 :           0 :   visit_outer_attrs (expr);
     482                 :           0 :   for (auto &pattern : expr.get_patterns ())
     483                 :           0 :     pattern->accept_vis (*this);
     484                 :           0 :   if (expr.has_loop_label ())
     485                 :           0 :     visit_loop_label (expr.get_loop_label ());
     486                 :           0 :   expr.get_cond ().accept_vis (*this);
     487                 :           0 :   expr.get_loop_block ().accept_vis (*this);
     488                 :           0 : }
     489                 :             : 
     490                 :             : void
     491                 :        1587 : DefaultHIRVisitor::walk (IfExpr &expr)
     492                 :             : {
     493                 :        1587 :   visit_outer_attrs (expr);
     494                 :        1587 :   expr.get_if_condition ().accept_vis (*this);
     495                 :        1587 :   expr.get_if_block ().accept_vis (*this);
     496                 :        1587 : }
     497                 :             : 
     498                 :             : void
     499                 :        1142 : DefaultHIRVisitor::walk (IfExprConseqElse &expr)
     500                 :             : {
     501                 :        1142 :   expr.IfExpr::accept_vis (*this);
     502                 :        1142 :   expr.get_else_block ().accept_vis (*this);
     503                 :        1142 : }
     504                 :             : 
     505                 :             : void
     506                 :        2306 : DefaultHIRVisitor::visit_match_arm (MatchArm &arm)
     507                 :             : {
     508                 :             :   // visit_outer_attrs (arm);
     509                 :        4612 :   for (auto &pattern : arm.get_patterns ())
     510                 :        2306 :     pattern->accept_vis (*this);
     511                 :        2306 :   if (arm.has_match_arm_guard ())
     512                 :           1 :     arm.get_guard_expr ().accept_vis (*this);
     513                 :        2306 : }
     514                 :             : 
     515                 :             : void
     516                 :        2306 : DefaultHIRVisitor::visit_match_case (MatchCase &arm)
     517                 :             : {
     518                 :        2306 :   visit_match_arm (arm.get_arm ());
     519                 :        2306 :   arm.get_expr ().accept_vis (*this);
     520                 :        2306 : }
     521                 :             : 
     522                 :             : void
     523                 :         977 : DefaultHIRVisitor::walk (MatchExpr &expr)
     524                 :             : {
     525                 :         977 :   visit_outer_attrs (expr);
     526                 :         977 :   visit_inner_attrs (expr);
     527                 :         977 :   expr.get_scrutinee_expr ().accept_vis (*this);
     528                 :        3283 :   for (auto &arm : expr.get_match_cases ())
     529                 :        2306 :     visit_match_case (arm);
     530                 :         977 : }
     531                 :             : 
     532                 :             : void
     533                 :           0 : DefaultHIRVisitor::walk (AwaitExpr &expr)
     534                 :             : {
     535                 :           0 :   visit_outer_attrs (expr);
     536                 :           0 :   expr.get_awaited_expr ().accept_vis (*this);
     537                 :           0 : }
     538                 :             : 
     539                 :             : void
     540                 :           0 : DefaultHIRVisitor::walk (AsyncBlockExpr &expr)
     541                 :             : {
     542                 :           0 :   visit_outer_attrs (expr);
     543                 :           0 :   expr.get_block_expr ().accept_vis (*this);
     544                 :           0 : }
     545                 :             : 
     546                 :             : void
     547                 :          24 : DefaultHIRVisitor::walk (InlineAsm &expr)
     548                 :             : {
     549                 :          24 :   visit_outer_attrs (expr);
     550                 :          24 :   auto &operands = expr.get_operands ();
     551                 :          24 :   using RegisterType = AST::InlineAsmOperand::RegisterType;
     552                 :          53 :   for (auto &operand : operands)
     553                 :             :     {
     554                 :          29 :       switch (operand.get_register_type ())
     555                 :             :         {
     556                 :          10 :         case RegisterType::In:
     557                 :          10 :           {
     558                 :          10 :             operand.get_in ().expr->accept_vis (*this);
     559                 :          10 :             break;
     560                 :             :           }
     561                 :          17 :         case RegisterType::Out:
     562                 :          17 :           {
     563                 :          17 :             operand.get_out ().expr->accept_vis (*this);
     564                 :          17 :             break;
     565                 :             :           }
     566                 :           0 :         case RegisterType::InOut:
     567                 :           0 :           {
     568                 :           0 :             operand.get_in_out ().expr->accept_vis (*this);
     569                 :           0 :             break;
     570                 :             :           }
     571                 :           2 :         case RegisterType::SplitInOut:
     572                 :           2 :           {
     573                 :           2 :             operand.get_split_in_out ().in_expr->accept_vis (*this);
     574                 :           2 :             operand.get_split_in_out ().out_expr->accept_vis (*this);
     575                 :           2 :             break;
     576                 :             :           }
     577                 :           0 :         case RegisterType::Const:
     578                 :           0 :           {
     579                 :           0 :             operand.get_const ().anon_const.get_inner_expr ().accept_vis (
     580                 :             :               *this);
     581                 :           0 :             break;
     582                 :             :           }
     583                 :           0 :         case RegisterType::Sym:
     584                 :           0 :           {
     585                 :           0 :             operand.get_sym ().expr->accept_vis (*this);
     586                 :           0 :             break;
     587                 :             :           }
     588                 :           0 :         case RegisterType::Label:
     589                 :           0 :           {
     590                 :           0 :             operand.get_label ().expr->accept_vis (*this);
     591                 :           0 :             break;
     592                 :             :           }
     593                 :             :         }
     594                 :             :     }
     595                 :          24 : }
     596                 :             : 
     597                 :             : void
     598                 :           2 : DefaultHIRVisitor::walk (LlvmInlineAsm &expr)
     599                 :             : {
     600                 :           2 :   for (auto &output : expr.outputs)
     601                 :           0 :     output.expr->accept_vis (*this);
     602                 :           4 :   for (auto &input : expr.inputs)
     603                 :           2 :     input.expr->accept_vis (*this);
     604                 :           2 : }
     605                 :             : 
     606                 :             : void
     607                 :           0 : DefaultHIRVisitor::walk (OffsetOf &expr)
     608                 :             : {
     609                 :           0 :   expr.get_type ().accept_vis (*this);
     610                 :           0 : }
     611                 :             : 
     612                 :             : void
     613                 :        7697 : DefaultHIRVisitor::walk (TypeParam &param)
     614                 :             : {
     615                 :        7697 :   visit_outer_attrs (param);
     616                 :        8496 :   for (auto &bounds : param.get_type_param_bounds ())
     617                 :         799 :     bounds->accept_vis (*this);
     618                 :        7697 :   if (param.has_type ())
     619                 :         346 :     param.get_type ().accept_vis (*this);
     620                 :        7697 : }
     621                 :             : 
     622                 :             : void
     623                 :           0 : DefaultHIRVisitor::walk (ConstGenericParam &const_param)
     624                 :             : {
     625                 :           0 :   visit_outer_attrs (const_param);
     626                 :           0 :   const_param.get_type ().accept_vis (*this);
     627                 :           0 :   if (const_param.has_default_expression ())
     628                 :           0 :     const_param.get_default_expression ().accept_vis (*this);
     629                 :           0 : }
     630                 :             : 
     631                 :             : void
     632                 :           0 : DefaultHIRVisitor::walk (LifetimeWhereClauseItem &item)
     633                 :             : {
     634                 :           0 :   item.get_lifetime ().accept_vis (*this);
     635                 :           0 :   for (auto &bound : item.get_lifetime_bounds ())
     636                 :           0 :     bound.accept_vis (*this);
     637                 :           0 : }
     638                 :             : 
     639                 :             : void
     640                 :         139 : DefaultHIRVisitor::walk (TypeBoundWhereClauseItem &item)
     641                 :             : {
     642                 :         146 :   for (auto &lifetime : item.get_for_lifetimes ())
     643                 :           7 :     lifetime.accept_vis (*this);
     644                 :         139 :   item.get_bound_type ().accept_vis (*this);
     645                 :         278 :   for (auto &param : item.get_type_param_bounds ())
     646                 :         139 :     param->accept_vis (*this);
     647                 :         139 : }
     648                 :             : 
     649                 :             : void
     650                 :        1149 : DefaultHIRVisitor::walk (Module &module)
     651                 :             : {
     652                 :        1149 :   visit_outer_attrs (module);
     653                 :        1149 :   visit_inner_attrs (module);
     654                 :        4826 :   for (auto &item : module.get_items ())
     655                 :        3677 :     item->accept_vis (*this);
     656                 :        1149 : }
     657                 :             : 
     658                 :             : void
     659                 :           0 : DefaultHIRVisitor::walk (ExternCrate &crate)
     660                 :             : {
     661                 :           0 :   visit_outer_attrs (crate);
     662                 :           0 : }
     663                 :             : 
     664                 :             : void
     665                 :           0 : DefaultHIRVisitor::walk (UseTreeGlob &)
     666                 :           0 : {}
     667                 :             : 
     668                 :             : void
     669                 :           0 : DefaultHIRVisitor::walk (UseTreeList &)
     670                 :           0 : {}
     671                 :             : 
     672                 :             : void
     673                 :           0 : DefaultHIRVisitor::walk (UseTreeRebind &)
     674                 :           0 : {}
     675                 :             : 
     676                 :             : void
     677                 :           0 : DefaultHIRVisitor::walk (UseDeclaration &)
     678                 :           0 : {}
     679                 :             : 
     680                 :             : void
     681                 :        7721 : DefaultHIRVisitor::visit_function_param (FunctionParam &param)
     682                 :             : {
     683                 :        7721 :   param.get_param_name ().accept_vis (*this);
     684                 :        7721 :   param.get_type ().accept_vis (*this);
     685                 :        7721 : }
     686                 :             : 
     687                 :             : void
     688                 :       12548 : DefaultHIRVisitor::walk (Function &function)
     689                 :             : {
     690                 :       12548 :   visit_outer_attrs (function);
     691                 :       13281 :   for (auto &generic : function.get_generic_params ())
     692                 :         733 :     generic->accept_vis (*this);
     693                 :       18668 :   for (auto &param : function.get_function_params ())
     694                 :        6120 :     visit_function_param (param);
     695                 :       12548 :   if (function.has_return_type ())
     696                 :        9240 :     function.get_return_type ().accept_vis (*this);
     697                 :       12548 :   if (function.has_where_clause ())
     698                 :          27 :     visit_where_clause (function.get_where_clause ());
     699                 :       12548 :   function.get_definition ().accept_vis (*this);
     700                 :       12548 : }
     701                 :             : 
     702                 :             : void
     703                 :        1198 : DefaultHIRVisitor::walk (TypeAlias &type_alias)
     704                 :             : {
     705                 :        1198 :   visit_outer_attrs (type_alias);
     706                 :        1205 :   for (auto &generic : type_alias.get_generic_params ())
     707                 :           7 :     generic->accept_vis (*this);
     708                 :        1198 :   if (type_alias.has_where_clause ())
     709                 :           0 :     visit_where_clause (type_alias.get_where_clause ());
     710                 :        1198 :   type_alias.get_type_aliased ().accept_vis (*this);
     711                 :        1198 : }
     712                 :             : 
     713                 :             : void
     714                 :        2012 : DefaultHIRVisitor::visit_struct_field (StructField &field)
     715                 :             : {
     716                 :        2012 :   field.get_field_type ().accept_vis (*this);
     717                 :        2012 : }
     718                 :             : 
     719                 :             : void
     720                 :        1398 : DefaultHIRVisitor::walk (StructStruct &struct_item)
     721                 :             : {
     722                 :        1398 :   visit_outer_attrs (struct_item);
     723                 :        1876 :   for (auto &generic : struct_item.get_generic_params ())
     724                 :         478 :     generic->accept_vis (*this);
     725                 :        1398 :   if (struct_item.has_where_clause ())
     726                 :           2 :     visit_where_clause (struct_item.get_where_clause ());
     727                 :        3125 :   for (auto &field : struct_item.get_fields ())
     728                 :        1727 :     visit_struct_field (field);
     729                 :        1398 : }
     730                 :             : 
     731                 :             : void
     732                 :         919 : DefaultHIRVisitor::walk (TupleStruct &tuple_struct)
     733                 :             : {
     734                 :         919 :   visit_outer_attrs (tuple_struct);
     735                 :        1263 :   for (auto &generic : tuple_struct.get_generic_params ())
     736                 :         344 :     generic->accept_vis (*this);
     737                 :         919 :   if (tuple_struct.has_where_clause ())
     738                 :           0 :     visit_where_clause (tuple_struct.get_where_clause ());
     739                 :        2476 :   for (auto &field : tuple_struct.get_fields ())
     740                 :        1557 :     field.get_field_type ().accept_vis (*this);
     741                 :         919 : }
     742                 :             : 
     743                 :             : void
     744                 :        1131 : DefaultHIRVisitor::walk (EnumItem &item)
     745                 :             : {
     746                 :        1131 :   visit_outer_attrs (item);
     747                 :        1131 : }
     748                 :             : 
     749                 :             : void
     750                 :         386 : DefaultHIRVisitor::walk (EnumItemTuple &item_tuple)
     751                 :             : {
     752                 :         386 :   item_tuple.EnumItem::accept_vis (*this);
     753                 :         796 :   for (auto &field : item_tuple.get_tuple_fields ())
     754                 :         410 :     field.get_field_type ().accept_vis (*this);
     755                 :         386 : }
     756                 :             : 
     757                 :             : void
     758                 :          76 : DefaultHIRVisitor::walk (EnumItemStruct &item_struct)
     759                 :             : {
     760                 :          76 :   item_struct.EnumItem::accept_vis (*this);
     761                 :         204 :   for (auto &field : item_struct.get_struct_fields ())
     762                 :         128 :     field.get_field_type ().accept_vis (*this);
     763                 :          76 : }
     764                 :             : 
     765                 :             : void
     766                 :         268 : DefaultHIRVisitor::walk (EnumItemDiscriminant &item)
     767                 :             : {
     768                 :         268 :   item.EnumItem::accept_vis (*this);
     769                 :         268 :   item.get_discriminant_expression ().accept_vis (*this);
     770                 :         268 : }
     771                 :             : 
     772                 :             : void
     773                 :         477 : DefaultHIRVisitor::walk (Enum &enum_item)
     774                 :             : {
     775                 :         477 :   visit_outer_attrs (enum_item);
     776                 :         744 :   for (auto &generic : enum_item.get_generic_params ())
     777                 :         267 :     generic->accept_vis (*this);
     778                 :         477 :   if (enum_item.has_where_clause ())
     779                 :           0 :     visit_where_clause (enum_item.get_where_clause ());
     780                 :        1608 :   for (auto &item : enum_item.get_variants ())
     781                 :        1131 :     item->accept_vis (*this);
     782                 :         477 : }
     783                 :             : 
     784                 :             : void
     785                 :          96 : DefaultHIRVisitor::walk (Union &union_item)
     786                 :             : {
     787                 :          96 :   visit_outer_attrs (union_item);
     788                 :         169 :   for (auto &generic : union_item.get_generic_params ())
     789                 :          73 :     generic->accept_vis (*this);
     790                 :          96 :   if (union_item.has_where_clause ())
     791                 :           0 :     visit_where_clause (union_item.get_where_clause ());
     792                 :         381 :   for (auto &variant : union_item.get_variants ())
     793                 :         285 :     visit_struct_field (variant);
     794                 :          96 : }
     795                 :             : 
     796                 :             : void
     797                 :         496 : DefaultHIRVisitor::walk (ConstantItem &const_item)
     798                 :             : {
     799                 :         496 :   visit_outer_attrs (const_item);
     800                 :         496 :   const_item.get_type ().accept_vis (*this);
     801                 :         496 :   const_item.get_expr ().accept_vis (*this);
     802                 :         496 : }
     803                 :             : 
     804                 :             : void
     805                 :          46 : DefaultHIRVisitor::walk (StaticItem &static_item)
     806                 :             : {
     807                 :          46 :   visit_outer_attrs (static_item);
     808                 :          46 :   static_item.get_type ().accept_vis (*this);
     809                 :          46 :   static_item.get_expr ().accept_vis (*this);
     810                 :          46 : }
     811                 :             : 
     812                 :             : void
     813                 :        2166 : DefaultHIRVisitor::visit_self_param (SelfParam &self_param)
     814                 :             : {
     815                 :        2166 :   if (self_param.has_lifetime ())
     816                 :             :     {
     817                 :        1614 :       Lifetime lifetime = self_param.get_lifetime ();
     818                 :        1614 :       lifetime.accept_vis (*this);
     819                 :        1614 :     }
     820                 :        2166 :   if (self_param.has_type ())
     821                 :           0 :     self_param.get_type ().accept_vis (*this);
     822                 :        2166 : }
     823                 :             : 
     824                 :             : void
     825                 :        2458 : DefaultHIRVisitor::walk (TraitItemFunc &item)
     826                 :             : {
     827                 :        2458 :   visit_outer_attrs (item);
     828                 :        2458 :   TraitFunctionDecl &decl = item.get_decl ();
     829                 :        2474 :   for (auto &generic : decl.get_generic_params ())
     830                 :          16 :     generic->accept_vis (*this);
     831                 :        2458 :   if (decl.get_self ().has_value ())
     832                 :        2166 :     visit_self_param (decl.get_self ().value ());
     833                 :        4059 :   for (auto &param : decl.get_function_params ())
     834                 :        1601 :     visit_function_param (param);
     835                 :        2458 :   if (decl.has_return_type ())
     836                 :        2058 :     decl.get_return_type ().accept_vis (*this);
     837                 :        2458 :   if (decl.has_where_clause ())
     838                 :           0 :     visit_where_clause (decl.get_where_clause ());
     839                 :        2458 :   if (item.has_definition ())
     840                 :         840 :     item.get_block_expr ().accept_vis (*this);
     841                 :        2458 : }
     842                 :             : 
     843                 :             : void
     844                 :          30 : DefaultHIRVisitor::walk (TraitItemConst &item)
     845                 :             : {
     846                 :          30 :   visit_outer_attrs (item);
     847                 :          30 :   item.get_type ().accept_vis (*this);
     848                 :          30 :   if (item.has_expr ())
     849                 :           7 :     item.get_expr ().accept_vis (*this);
     850                 :          30 : }
     851                 :             : 
     852                 :             : void
     853                 :         700 : DefaultHIRVisitor::walk (TraitItemType &item)
     854                 :             : {
     855                 :         700 :   visit_outer_attrs (item);
     856                 :         700 :   for (auto &bound : item.get_type_param_bounds ())
     857                 :           0 :     bound->accept_vis (*this);
     858                 :         700 : }
     859                 :             : 
     860                 :             : void
     861                 :           0 : DefaultHIRVisitor::visit_where_clause (const WhereClause &where_clause)
     862                 :             : {
     863                 :           0 :   for (auto &item : where_clause.get_items ())
     864                 :           0 :     item->accept_vis (*this);
     865                 :           0 : }
     866                 :             : 
     867                 :             : void
     868                 :         119 : DefaultHIRVisitor::visit_where_clause (WhereClause &where_clause)
     869                 :             : {
     870                 :         258 :   for (auto &item : where_clause.get_items ())
     871                 :             :     {
     872                 :         139 :       item->accept_vis (*this);
     873                 :             :     }
     874                 :         119 : }
     875                 :             : 
     876                 :             : void
     877                 :           0 : DefaultHIRVisitor::walk (WhereClauseItem &node)
     878                 :           0 : {}
     879                 :             : 
     880                 :             : void
     881                 :        3475 : DefaultHIRVisitor::walk (Trait &trait)
     882                 :             : {
     883                 :        3475 :   visit_outer_attrs (trait);
     884                 :        7576 :   for (auto &generic : trait.get_generic_params ())
     885                 :        4101 :     generic->accept_vis (*this);
     886                 :        3475 :   if (trait.has_where_clause ())
     887                 :           7 :     visit_where_clause (trait.get_where_clause ());
     888                 :        4053 :   for (auto &bound : trait.get_type_param_bounds ())
     889                 :         578 :     bound->accept_vis (*this);
     890                 :        6663 :   for (auto &item : trait.get_trait_items ())
     891                 :        3188 :     item->accept_vis (*this);
     892                 :        3475 : }
     893                 :             : 
     894                 :             : void
     895                 :        5303 : DefaultHIRVisitor::walk (ImplBlock &impl)
     896                 :             : {
     897                 :        5303 :   visit_outer_attrs (impl);
     898                 :        6359 :   for (auto &generic : impl.get_generic_params ())
     899                 :        1056 :     generic->accept_vis (*this);
     900                 :        5303 :   if (impl.has_trait_ref ())
     901                 :        4394 :     impl.get_trait_ref ().accept_vis (*this);
     902                 :        5303 :   impl.get_type ().accept_vis (*this);
     903                 :        5303 :   if (impl.has_where_clause ())
     904                 :          83 :     visit_where_clause (impl.get_where_clause ());
     905                 :        5303 :   visit_inner_attrs (impl);
     906                 :       13169 :   for (auto &item : impl.get_impl_items ())
     907                 :        7866 :     item->accept_vis (*this);
     908                 :        5303 : }
     909                 :             : 
     910                 :             : void
     911                 :           0 : DefaultHIRVisitor::walk (ExternalStaticItem &item)
     912                 :             : {
     913                 :           0 :   visit_outer_attrs (item);
     914                 :           0 :   item.get_item_type ().accept_vis (*this);
     915                 :           0 : }
     916                 :             : 
     917                 :             : void
     918                 :        2628 : DefaultHIRVisitor::visit_named_function_param (NamedFunctionParam &param)
     919                 :             : {
     920                 :        2628 :   param.get_type ().accept_vis (*this);
     921                 :        2628 : }
     922                 :             : 
     923                 :             : void
     924                 :        2156 : DefaultHIRVisitor::walk (ExternalFunctionItem &item)
     925                 :             : {
     926                 :        2156 :   visit_outer_attrs (item);
     927                 :        2999 :   for (auto &generic : item.get_generic_params ())
     928                 :         843 :     generic->accept_vis (*this);
     929                 :        4784 :   for (auto &param : item.get_function_params ())
     930                 :        2628 :     visit_named_function_param (param);
     931                 :        2156 :   if (item.has_return_type ())
     932                 :         990 :     item.get_return_type ().accept_vis (*this);
     933                 :        2156 :   if (item.has_where_clause ())
     934                 :           0 :     visit_where_clause (item.get_where_clause ());
     935                 :        2156 : }
     936                 :             : 
     937                 :             : void
     938                 :           0 : DefaultHIRVisitor::walk (ExternalTypeItem &item)
     939                 :             : {
     940                 :           0 :   visit_outer_attrs (item);
     941                 :           0 : }
     942                 :             : 
     943                 :             : void
     944                 :        1422 : DefaultHIRVisitor::walk (ExternBlock &block)
     945                 :             : {
     946                 :        1422 :   visit_outer_attrs (block);
     947                 :        1422 :   visit_inner_attrs (block);
     948                 :        3578 :   for (auto &item : block.get_extern_items ())
     949                 :        2156 :     item->accept_vis (*this);
     950                 :        1422 : }
     951                 :             : 
     952                 :             : void
     953                 :         392 : DefaultHIRVisitor::walk (LiteralPattern &)
     954                 :         392 : {}
     955                 :             : 
     956                 :             : void
     957                 :        8289 : DefaultHIRVisitor::walk (IdentifierPattern &pattern)
     958                 :             : {
     959                 :        8289 :   if (pattern.has_subpattern ())
     960                 :           9 :     pattern.get_subpattern ().accept_vis (*this);
     961                 :        8289 : }
     962                 :             : 
     963                 :             : void
     964                 :         729 : DefaultHIRVisitor::walk (WildcardPattern &)
     965                 :         729 : {}
     966                 :             : 
     967                 :             : void
     968                 :          53 : DefaultHIRVisitor::walk (RangePatternBoundLiteral &)
     969                 :          53 : {}
     970                 :             : 
     971                 :             : void
     972                 :          21 : DefaultHIRVisitor::walk (RangePatternBoundPath &bound)
     973                 :             : {
     974                 :          21 :   bound.get_path ().accept_vis (*this);
     975                 :          21 : }
     976                 :             : 
     977                 :             : void
     978                 :           0 : DefaultHIRVisitor::walk (RangePatternBoundQualPath &bound)
     979                 :             : {
     980                 :           0 :   bound.get_qualified_path ().accept_vis (*this);
     981                 :           0 : }
     982                 :             : 
     983                 :             : void
     984                 :          37 : DefaultHIRVisitor::walk (RangePattern &pattern)
     985                 :             : {
     986                 :          37 :   pattern.get_lower_bound ().accept_vis (*this);
     987                 :          37 :   pattern.get_upper_bound ().accept_vis (*this);
     988                 :          37 : }
     989                 :             : 
     990                 :             : void
     991                 :         173 : DefaultHIRVisitor::walk (ReferencePattern &pattern)
     992                 :             : {
     993                 :         173 :   pattern.get_referenced_pattern ().accept_vis (*this);
     994                 :         173 : }
     995                 :             : 
     996                 :             : void
     997                 :           0 : DefaultHIRVisitor::walk (StructPatternFieldTuplePat &field)
     998                 :             : {
     999                 :           0 :   visit_outer_attrs (field);
    1000                 :           0 :   field.get_tuple_pattern ().accept_vis (*this);
    1001                 :           0 : }
    1002                 :             : 
    1003                 :             : void
    1004                 :         114 : DefaultHIRVisitor::walk (StructPatternFieldIdentPat &field)
    1005                 :             : {
    1006                 :         114 :   visit_outer_attrs (field);
    1007                 :         114 :   field.get_pattern ().accept_vis (*this);
    1008                 :         114 : }
    1009                 :             : 
    1010                 :             : void
    1011                 :          89 : DefaultHIRVisitor::walk (StructPatternFieldIdent &field)
    1012                 :             : {
    1013                 :          89 :   visit_outer_attrs (field);
    1014                 :          89 : }
    1015                 :             : 
    1016                 :             : void
    1017                 :         121 : DefaultHIRVisitor::walk (StructPattern &pattern)
    1018                 :             : {
    1019                 :         121 :   pattern.get_path ().accept_vis (*this);
    1020                 :         121 :   StructPatternElements &elements = pattern.get_struct_pattern_elems ();
    1021                 :         324 :   for (auto &field : elements.get_struct_pattern_fields ())
    1022                 :         203 :     field->accept_vis (*this);
    1023                 :         121 : }
    1024                 :             : 
    1025                 :             : void
    1026                 :         878 : DefaultHIRVisitor::walk (TupleStructItemsNoRest &tuple_items)
    1027                 :             : {
    1028                 :        1844 :   for (auto &item : tuple_items.get_patterns ())
    1029                 :         966 :     item->accept_vis (*this);
    1030                 :         878 : }
    1031                 :             : 
    1032                 :             : void
    1033                 :          36 : DefaultHIRVisitor::walk (TupleStructItemsHasRest &tuple_items)
    1034                 :             : {
    1035                 :          65 :   for (auto &lower : tuple_items.get_lower_patterns ())
    1036                 :          29 :     lower->accept_vis (*this);
    1037                 :          50 :   for (auto &upper : tuple_items.get_upper_patterns ())
    1038                 :          14 :     upper->accept_vis (*this);
    1039                 :          36 : }
    1040                 :             : 
    1041                 :             : void
    1042                 :         914 : DefaultHIRVisitor::walk (TupleStructPattern &pattern)
    1043                 :             : {
    1044                 :         914 :   pattern.get_path ().accept_vis (*this);
    1045                 :         914 :   pattern.get_items ().accept_vis (*this);
    1046                 :         914 : }
    1047                 :             : 
    1048                 :             : void
    1049                 :          98 : DefaultHIRVisitor::walk (TuplePatternItemsNoRest &tuple_items)
    1050                 :             : {
    1051                 :         301 :   for (auto &pattern : tuple_items.get_patterns ())
    1052                 :         203 :     pattern->accept_vis (*this);
    1053                 :          98 : }
    1054                 :             : 
    1055                 :             : void
    1056                 :          22 : DefaultHIRVisitor::walk (TuplePatternItemsHasRest &tuple_items)
    1057                 :             : {
    1058                 :          44 :   for (auto &lower : tuple_items.get_lower_patterns ())
    1059                 :          22 :     lower->accept_vis (*this);
    1060                 :          44 :   for (auto &upper : tuple_items.get_upper_patterns ())
    1061                 :          22 :     upper->accept_vis (*this);
    1062                 :          22 : }
    1063                 :             : 
    1064                 :             : void
    1065                 :         120 : DefaultHIRVisitor::walk (TuplePattern &pattern)
    1066                 :             : {
    1067                 :         120 :   pattern.get_items ().accept_vis (*this);
    1068                 :         120 : }
    1069                 :             : 
    1070                 :             : void
    1071                 :          31 : DefaultHIRVisitor::walk (SlicePatternItemsNoRest &items)
    1072                 :             : {
    1073                 :          92 :   for (auto &pattern : items.get_patterns ())
    1074                 :          61 :     pattern->accept_vis (*this);
    1075                 :          31 : }
    1076                 :             : 
    1077                 :             : void
    1078                 :          44 : DefaultHIRVisitor::walk (SlicePatternItemsHasRest &items)
    1079                 :             : {
    1080                 :          87 :   for (auto &lower : items.get_lower_patterns ())
    1081                 :          43 :     lower->accept_vis (*this);
    1082                 :          87 :   for (auto &upper : items.get_upper_patterns ())
    1083                 :          43 :     upper->accept_vis (*this);
    1084                 :          44 : }
    1085                 :             : 
    1086                 :             : void
    1087                 :          75 : DefaultHIRVisitor::walk (SlicePattern &pattern)
    1088                 :             : {
    1089                 :          75 :   pattern.get_items ().accept_vis (*this);
    1090                 :          75 : }
    1091                 :             : 
    1092                 :             : void
    1093                 :         145 : DefaultHIRVisitor::walk (AltPattern &pattern)
    1094                 :             : {
    1095                 :         436 :   for (auto &item : pattern.get_alts ())
    1096                 :         291 :     item->accept_vis (*this);
    1097                 :         145 : }
    1098                 :             : 
    1099                 :             : void
    1100                 :          44 : DefaultHIRVisitor::walk (EmptyStmt &stmt)
    1101                 :          44 : {}
    1102                 :             : 
    1103                 :             : void
    1104                 :           0 : DefaultHIRVisitor::walk (LetStmt &stmt)
    1105                 :             : {
    1106                 :           0 :   visit_outer_attrs (stmt);
    1107                 :           0 :   stmt.get_pattern ().accept_vis (*this);
    1108                 :           0 :   if (stmt.has_type ())
    1109                 :           0 :     stmt.get_type ().accept_vis (*this);
    1110                 :           0 :   if (stmt.has_init_expr ())
    1111                 :           0 :     stmt.get_init_expr ().accept_vis (*this);
    1112                 :           0 : }
    1113                 :             : 
    1114                 :             : void
    1115                 :        8845 : DefaultHIRVisitor::walk (ExprStmt &stmt)
    1116                 :             : {
    1117                 :        8845 :   stmt.get_expr ().accept_vis (*this);
    1118                 :        8845 : }
    1119                 :             : 
    1120                 :             : void
    1121                 :        1636 : DefaultHIRVisitor::walk (TraitBound &bound)
    1122                 :             : {
    1123                 :        1643 :   for (auto &lifetime : bound.get_for_lifetimes ())
    1124                 :           7 :     lifetime.accept_vis (*this);
    1125                 :        1636 :   bound.get_path ().accept_vis (*this);
    1126                 :        1636 : }
    1127                 :             : 
    1128                 :             : void
    1129                 :          28 : DefaultHIRVisitor::walk (ImplTraitType &type)
    1130                 :             : {
    1131                 :          56 :   for (auto &bound : type.get_type_param_bounds ())
    1132                 :          28 :     bound->accept_vis (*this);
    1133                 :          28 : }
    1134                 :             : 
    1135                 :             : void
    1136                 :          91 : DefaultHIRVisitor::walk (TraitObjectType &type)
    1137                 :             : {
    1138                 :         194 :   for (auto &bound : type.get_type_param_bounds ())
    1139                 :         103 :     bound->accept_vis (*this);
    1140                 :          91 : }
    1141                 :             : 
    1142                 :             : void
    1143                 :           1 : DefaultHIRVisitor::walk (ParenthesisedType &type)
    1144                 :             : {
    1145                 :           1 :   type.get_type_in_parens ().accept_vis (*this);
    1146                 :           1 : }
    1147                 :             : 
    1148                 :             : void
    1149                 :         305 : DefaultHIRVisitor::walk (TupleType &type)
    1150                 :             : {
    1151                 :         812 :   for (auto &elem : type.get_elems ())
    1152                 :         507 :     elem->accept_vis (*this);
    1153                 :         305 : }
    1154                 :             : 
    1155                 :             : void
    1156                 :          43 : DefaultHIRVisitor::walk (NeverType &type)
    1157                 :          43 : {}
    1158                 :             : 
    1159                 :             : void
    1160                 :        3913 : DefaultHIRVisitor::walk (RawPointerType &type)
    1161                 :             : {
    1162                 :        3913 :   type.get_type ().accept_vis (*this);
    1163                 :        3913 : }
    1164                 :             : 
    1165                 :             : void
    1166                 :        3961 : DefaultHIRVisitor::walk (ReferenceType &type)
    1167                 :             : {
    1168                 :        3961 :   if (type.has_lifetime ())
    1169                 :        3961 :     type.get_lifetime ().accept_vis (*this);
    1170                 :        3961 :   type.get_base_type ().accept_vis (*this);
    1171                 :        3961 : }
    1172                 :             : 
    1173                 :             : void
    1174                 :         470 : DefaultHIRVisitor::walk (ArrayType &type)
    1175                 :             : {
    1176                 :         470 :   type.get_element_type ().accept_vis (*this);
    1177                 :         470 :   type.get_size_expr ().accept_vis (*this);
    1178                 :         470 : }
    1179                 :             : 
    1180                 :             : void
    1181                 :         819 : DefaultHIRVisitor::walk (SliceType &type)
    1182                 :             : {
    1183                 :         819 :   type.get_element_type ().accept_vis (*this);
    1184                 :         819 : }
    1185                 :             : 
    1186                 :             : void
    1187                 :          14 : DefaultHIRVisitor::walk (InferredType &type)
    1188                 :          14 : {}
    1189                 :             : 
    1190                 :             : void
    1191                 :          33 : DefaultHIRVisitor::walk (BareFunctionType &type)
    1192                 :             : {
    1193                 :          33 :   for (auto &lifetime : type.get_for_lifetimes ())
    1194                 :           0 :     lifetime.accept_vis (*this);
    1195                 :          54 :   for (auto &param : type.get_function_params ())
    1196                 :          21 :     param.get_type ().accept_vis (*this);
    1197                 :          33 :   if (type.has_return_type ())
    1198                 :          23 :     type.get_return_type ().accept_vis (*this);
    1199                 :          33 : }
    1200                 :             : 
    1201                 :             : } // namespace HIR
    1202                 :             : } // namespace Rust
        

Generated by: LCOV version 2.1-beta

LCOV profile is generated on x86_64 machine using following configure options: configure --disable-bootstrap --enable-coverage=opt --enable-languages=c,c++,fortran,go,jit,lto,rust,m2 --enable-host-shared. GCC test suite is run with the built compiler.