LCOV - code coverage report
Current view: top level - gcc/rust/util - rust-common.h (source / functions) Coverage Total Hit
Test: gcc.info Lines: 0.0 % 9 0
Test Date: 2024-04-27 14:03:13 Functions: 0.0 % 1 0
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : // Copyright (C) 2021-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                 :             : // Common definitions useful throughout the Rust frontend.
      20                 :             : 
      21                 :             : #ifndef RUST_COMMON
      22                 :             : #define RUST_COMMON
      23                 :             : #include "rust-system.h"
      24                 :             : #include <string>
      25                 :             : 
      26                 :             : namespace Rust {
      27                 :             : 
      28                 :             : enum class Mutability
      29                 :             : {
      30                 :             :   Imm,
      31                 :             :   Mut
      32                 :             : };
      33                 :             : 
      34                 :             : enum class Unsafety
      35                 :             : {
      36                 :             :   Unsafe,
      37                 :             :   Normal
      38                 :             : };
      39                 :             : 
      40                 :             : enum class Const
      41                 :             : {
      42                 :             :   Yes,
      43                 :             :   No,
      44                 :             : };
      45                 :             : 
      46                 :             : enum class Async
      47                 :             : {
      48                 :             :   Yes,
      49                 :             :   No
      50                 :             : };
      51                 :             : 
      52                 :             : enum BoundPolarity
      53                 :             : {
      54                 :             :   RegularBound,
      55                 :             :   NegativeBound,
      56                 :             :   AntiBound,
      57                 :             : };
      58                 :             : 
      59                 :             : enum AsyncConstStatus
      60                 :             : {
      61                 :             :   NONE,
      62                 :             :   CONST_FN,
      63                 :             :   ASYNC_FN
      64                 :             : };
      65                 :             : 
      66                 :             : inline std::string
      67                 :           0 : enum_to_str (Mutability mut)
      68                 :             : {
      69                 :           0 :   std::string str;
      70                 :           0 :   switch (mut)
      71                 :             :     {
      72                 :           0 :     case Mutability::Imm:
      73                 :           0 :       return "Imm";
      74                 :           0 :     case Mutability::Mut:
      75                 :           0 :       return "Mut";
      76                 :             :     }
      77                 :           0 :   gcc_unreachable ();
      78                 :           0 : }
      79                 :             : 
      80                 :             : } // namespace Rust
      81                 :             : 
      82                 :             : #endif // RUST_COMMON
        

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.