LCOV - code coverage report
Current view: top level - gcc/rust/backend - rust-compile-fnparam.h (source / functions) Coverage Total Hit
Test: gcc.info Lines: 14.3 % 7 1
Test Date: 2026-02-28 14:20:25 Functions: 0.0 % 6 0
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_COMPILE_FNPARAM
      20              : #define RUST_COMPILE_FNPARAM
      21              : 
      22              : #include "rust-compile-base.h"
      23              : #include "rust-hir-visitor.h"
      24              : 
      25              : namespace Rust {
      26              : namespace Compile {
      27              : 
      28         9420 : class CompileFnParam : private HIRCompileBase, protected HIR::HIRPatternVisitor
      29              : {
      30              : public:
      31              :   static Bvariable *compile (Context *ctx, tree fndecl,
      32              :                              HIR::FunctionParam &param, tree decl_type,
      33              :                              location_t locus);
      34              :   static Bvariable *compile (Context *ctx, tree fndecl, HIR::Pattern &param,
      35              :                              tree decl_type, location_t locus);
      36              : 
      37              :   void visit (HIR::IdentifierPattern &pattern) override;
      38              :   void visit (HIR::WildcardPattern &pattern) override;
      39              :   void visit (HIR::StructPattern &) override;
      40              :   void visit (HIR::TupleStructPattern &) override;
      41              :   void visit (HIR::ReferencePattern &) override;
      42              : 
      43              :   // Empty visit for unused Pattern HIR nodes.
      44            0 :   void visit (HIR::AltPattern &) override {}
      45            0 :   void visit (HIR::LiteralPattern &) override {}
      46            0 :   void visit (HIR::PathInExpression &) override {}
      47            0 :   void visit (HIR::QualifiedPathInExpression &) override {}
      48            0 :   void visit (HIR::RangePattern &) override {}
      49            0 :   void visit (HIR::SlicePattern &) override {}
      50              :   void visit (HIR::TuplePattern &) override;
      51              : 
      52              : private:
      53              :   CompileFnParam (Context *ctx, tree fndecl, tree decl_type, location_t locus);
      54              : 
      55              :   Bvariable *create_tmp_param_var (tree decl_type);
      56              : 
      57              :   tree fndecl;
      58              :   tree decl_type;
      59              :   location_t locus;
      60              :   Bvariable *compiled_param;
      61              : };
      62              : 
      63              : class CompileSelfParam : private HIRCompileBase
      64              : {
      65              : public:
      66              :   static Bvariable *compile (Context *ctx, tree fndecl, HIR::SelfParam &self,
      67              :                              tree decl_type, location_t locus);
      68              : };
      69              : 
      70              : } // namespace Compile
      71              : } // namespace Rust
      72              : 
      73              : #endif // RUST_COMPILE_FNPARAM
        

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.