LCOV - code coverage report
Current view: top level - gcc/rust/hir - rust-ast-lower-struct-field-expr.h (source / functions) Coverage Total Hit
Test: gcc.info Lines: 100.0 % 11 11
Test Date: 2026-02-28 14:20:25 Functions: 100.0 % 3 3
Legend: Lines:     hit not hit

            Line data    Source code
       1              : // Copyright (C) 2020-2026 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              : #ifndef RUST_AST_LOWER_STRUCT_FIELD_EXPR
      20              : #define RUST_AST_LOWER_STRUCT_FIELD_EXPR
      21              : 
      22              : #include "rust-diagnostics.h"
      23              : #include "rust-ast-lower-base.h"
      24              : 
      25              : namespace Rust {
      26              : namespace HIR {
      27              : 
      28              : class ASTLowerStructExprField : public ASTLoweringBase
      29              : {
      30              :   using Rust::HIR::ASTLoweringBase::visit;
      31              : 
      32              : public:
      33         2284 :   static HIR::StructExprField *translate (AST::StructExprField &field)
      34              :   {
      35         4568 :     ASTLowerStructExprField compiler;
      36         2284 :     field.accept_vis (compiler);
      37         2284 :     rust_assert (compiler.translated != nullptr);
      38              : 
      39         2284 :     compiler.mappings.insert_hir_struct_field (compiler.translated);
      40         2284 :     compiler.mappings.insert_location (
      41         2284 :       compiler.translated->get_mappings ().get_hirid (), field.get_locus ());
      42              : 
      43         2284 :     return compiler.translated;
      44         2284 :   }
      45              : 
      46         2284 :   ~ASTLowerStructExprField () {}
      47              : 
      48              :   void visit (AST::StructExprFieldIdentifierValue &field) override;
      49              : 
      50              :   void visit (AST::StructExprFieldIndexValue &field) override;
      51              : 
      52              :   void visit (AST::StructExprFieldIdentifier &field) override;
      53              : 
      54              : private:
      55         2284 :   ASTLowerStructExprField () : translated (nullptr) {}
      56              : 
      57              :   HIR::StructExprField *translated;
      58              : };
      59              : 
      60              : } // namespace HIR
      61              : } // namespace Rust
      62              : 
      63              : #endif // RUST_AST_LOWER_STRUCT_FIELD_EXPR
        

Generated by: LCOV version 2.4-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.