LCOV - code coverage report
Current view: top level - gcc/go/gofrontend - go-dump.cc (source / functions) Coverage Total Hit
Test: gcc.info Lines: 28.6 % 14 4
Test Date: 2026-02-28 14:20:25 Functions: 33.3 % 3 1
Legend: Lines:     hit not hit

            Line data    Source code
       1              : // go-dump.cc -- Go frontend debug dumps.
       2              : 
       3              : // Copyright 2009 The Go Authors. All rights reserved.
       4              : // Use of this source code is governed by a BSD-style
       5              : // license that can be found in the LICENSE file.
       6              : 
       7              : #include "go-system.h"
       8              : 
       9              : #include "go-c.h"
      10              : #include "go-dump.h"
      11              : 
      12              : namespace {
      13              : 
      14              : // The list of dumps.
      15              : 
      16              : Go_dump* dumps;
      17              : 
      18              : } // End empty namespace.
      19              : 
      20              : // Create a new dump.
      21              : 
      22         4646 : Go_dump::Go_dump(const char* name)
      23         4646 :   : next_(dumps), name_(name), is_enabled_(false)
      24              : {
      25         4646 :   dumps = this;
      26         4646 : }
      27              : 
      28              : // Enable a dump by name.
      29              : 
      30              : bool
      31            0 : Go_dump::enable_by_name(const char* name)
      32              : {
      33            0 :   bool is_all = strcmp(name, "all") == 0;
      34            0 :   bool found = false;
      35            0 :   for (Go_dump* p = dumps; p != NULL; p = p->next_)
      36              :     {
      37            0 :       if (is_all || strcmp(name, p->name_) == 0)
      38              :         {
      39            0 :           p->is_enabled_ = true;
      40            0 :           found = true;
      41              :         }
      42              :     }
      43            0 :   return found;
      44              : }
      45              : 
      46              : // Enable a dump.  Return 1 if this is a real name, 0 if not.
      47              : 
      48              : GO_EXTERN_C
      49              : int
      50            0 : go_enable_dump(const char* name)
      51              : {
      52            0 :   return Go_dump::enable_by_name(name) ? 1 : 0;
      53              : }
        

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.