LCOV - code coverage report
Current view: top level - gcc/go - go-location.h (source / functions) Hit Total Coverage
Test: gcc.info Lines: 7 7 100.0 %
Date: 2020-03-28 11:57:23 Functions: 0 0 -
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // go-location.h -- GCC specific Location declaration.   -*- C++ -*-
       2                 :            : 
       3                 :            : // Copyright 2011 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                 :            : #ifndef GO_LOCATION_H
       8                 :            : #define GO_LOCATION_H
       9                 :            : 
      10                 :            : #include "go-system.h"
      11                 :            : 
      12                 :            : // A location in an input source file.
      13                 :            : 
      14                 :            : class Location
      15                 :            : {
      16                 :            :  public:
      17                 :     231182 :   Location()
      18                 :     231182 :     : gcc_loc_(UNKNOWN_LOCATION)
      19                 :            :   { }
      20                 :            : 
      21                 :   38575300 :   explicit Location(location_t loc)
      22                 :            :     : gcc_loc_(loc)
      23                 :            :   { }
      24                 :            : 
      25                 :            :   location_t
      26                 :   47896358 :   gcc_location() const
      27                 :   39835831 :   { return this->gcc_loc_; }
      28                 :            : 
      29                 :            :  private:
      30                 :            :   location_t gcc_loc_;
      31                 :            : };
      32                 :            : 
      33                 :            : // The Go frontend requires the ability to compare Locations.
      34                 :            : 
      35                 :            : inline bool
      36                 :            : operator<(Location loca, Location locb)
      37                 :            : {
      38                 :            :   return loca.gcc_location() < locb.gcc_location();
      39                 :            : }
      40                 :            : 
      41                 :            : inline bool
      42                 :        659 : operator==(Location loca, Location locb)
      43                 :            : {
      44                 :        659 :   return loca.gcc_location() == locb.gcc_location();
      45                 :            : }
      46                 :            : 
      47                 :            : #endif // !defined(GO_LOCATION_H)

Generated by: LCOV version 1.0

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 --enable-host-shared. GCC test suite is run with the built compiler.