LCOV - code coverage report
Current view: top level - gcc/rust/resolve - rust-ast-resolve-struct-expr-field.cc (source / functions) Coverage Total Hit
Test: gcc.info Lines: 100.0 % 19 19
Test Date: 2024-04-20 14:03:02 Functions: 100.0 % 5 5
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : // Copyright (C) 2020-2024 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-ast-resolve-struct-expr-field.h"
      20                 :             : #include "rust-ast-resolve-expr.h"
      21                 :             : 
      22                 :             : namespace Rust {
      23                 :             : namespace Resolver {
      24                 :             : 
      25                 :             : void
      26                 :        1545 : ResolveStructExprField::go (AST::StructExprField *field,
      27                 :             :                             const CanonicalPath &prefix,
      28                 :             :                             const CanonicalPath &canonical_prefix)
      29                 :             : {
      30                 :        1545 :   ResolveStructExprField resolver (prefix, canonical_prefix);
      31                 :        1545 :   field->accept_vis (resolver);
      32                 :        1545 : }
      33                 :             : 
      34                 :        1545 : ResolveStructExprField::ResolveStructExprField (
      35                 :        1545 :   const CanonicalPath &prefix, const CanonicalPath &canonical_prefix)
      36                 :        1545 :   : ResolverBase (), prefix (prefix), canonical_prefix (canonical_prefix)
      37                 :        1545 : {}
      38                 :             : 
      39                 :             : void
      40                 :        1290 : ResolveStructExprField::visit (AST::StructExprFieldIdentifierValue &field)
      41                 :             : {
      42                 :        1290 :   ResolveExpr::go (field.get_value ().get (), prefix, canonical_prefix);
      43                 :        1290 : }
      44                 :             : 
      45                 :             : void
      46                 :          44 : ResolveStructExprField::visit (AST::StructExprFieldIndexValue &field)
      47                 :             : {
      48                 :          44 :   ResolveExpr::go (field.get_value ().get (), prefix, canonical_prefix);
      49                 :          44 : }
      50                 :             : 
      51                 :             : void
      52                 :         211 : ResolveStructExprField::visit (AST::StructExprFieldIdentifier &field)
      53                 :             : {
      54                 :         211 :   AST::IdentifierExpr expr (field.get_field_name (), {}, field.get_locus ());
      55                 :         211 :   expr.set_node_id (field.get_node_id ());
      56                 :             : 
      57                 :         211 :   ResolveExpr::go (&expr, prefix, canonical_prefix);
      58                 :         211 : }
      59                 :             : 
      60                 :             : } // namespace Resolver
      61                 :             : } // 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.