LCOV - code coverage report
Current view: top level - gcc/rust/backend - rust-mangle.h (source / functions) Coverage Total Hit
Test: gcc.info Lines: 100.0 % 3 3
Test Date: 2024-04-20 14:03:02 Functions: - 0 0
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : // This file is part of GCC.
       2                 :             : 
       3                 :             : // GCC is free software; you can redistribute it and/or modify it under
       4                 :             : // the terms of the GNU General Public License as published by the Free
       5                 :             : // Software Foundation; either version 3, or (at your option) any later
       6                 :             : // version.
       7                 :             : 
       8                 :             : // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
       9                 :             : // WARRANTY; without even the implied warranty of MERCHANTABILITY or
      10                 :             : // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      11                 :             : // for more details.
      12                 :             : 
      13                 :             : // You should have received a copy of the GNU General Public License
      14                 :             : // along with GCC; see the file COPYING3.  If not see
      15                 :             : // <http://www.gnu.org/licenses/>.
      16                 :             : 
      17                 :             : #ifndef RUST_MANGLE_H
      18                 :             : #define RUST_MANGLE_H
      19                 :             : 
      20                 :             : #include "rust-system.h"
      21                 :             : #include "rust-tyty.h"
      22                 :             : 
      23                 :             : namespace Rust {
      24                 :             : namespace Compile {
      25                 :             : 
      26                 :             : class Context;
      27                 :             : 
      28                 :             : class Mangler
      29                 :             : {
      30                 :             : public:
      31                 :             :   enum MangleVersion
      32                 :             :   {
      33                 :             :     // Values defined in rust/lang.opt
      34                 :             :     LEGACY = 0,
      35                 :             :     V0 = 1,
      36                 :             :   };
      37                 :             : 
      38                 :             :   // this needs to support Legacy and V0 see github #429 or #305
      39                 :             :   std::string mangle_item (Rust::Compile::Context *ctx,
      40                 :             :                            const TyTy::BaseType *ty,
      41                 :             :                            const Resolver::CanonicalPath &path) const;
      42                 :             : 
      43                 :           2 :   static void set_mangling (int frust_mangling_value)
      44                 :             :   {
      45                 :           2 :     version = static_cast<MangleVersion> (frust_mangling_value);
      46                 :           2 :   }
      47                 :             : 
      48                 :             : private:
      49                 :             :   static enum MangleVersion version;
      50                 :             : };
      51                 :             : 
      52                 :             : std::string
      53                 :             : legacy_mangle_item (const TyTy::BaseType *ty,
      54                 :             :                     const Resolver::CanonicalPath &path);
      55                 :             : 
      56                 :             : std::string
      57                 :             : v0_mangle_item (Rust::Compile::Context *ctx, const TyTy::BaseType *ty,
      58                 :             :                 const Resolver::CanonicalPath &path);
      59                 :             : 
      60                 :             : } // namespace Compile
      61                 :             : } // namespace Rust
      62                 :             : #endif // RUST_MANGLE_H
        

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.