]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/gcov.c
Update copyright years.
[thirdparty/gcc.git] / gcc / gcov.c
index c65b7153765d2ea4f2ba8121fdfab9f472d160cb..1dca304977758b8c37d9d948f6a39f3a76744a78 100644 (file)
@@ -1,6 +1,6 @@
 /* Gcov.c: prepend line execution counts and branch probabilities to a
    source file.
-   Copyright (C) 1990-2019 Free Software Foundation, Inc.
+   Copyright (C) 1990-2020 Free Software Foundation, Inc.
    Contributed by James E. Wilson of Cygnus Support.
    Mangled by Bob Manson of Cygnus Support.
    Mangled further by Nathan Sidwell <nathan@codesourcery.com>
@@ -730,10 +730,10 @@ unblock (const block_info *u, block_vector_t &blocked,
 /* Return true when PATH contains a zero cycle arc count.  */
 
 static bool
-path_contains_zero_cycle_arc (arc_vector_t &path)
+path_contains_zero_or_negative_cycle_arc (arc_vector_t &path)
 {
   for (unsigned i = 0; i < path.size (); i++)
-    if (path[i]->cs_count == 0)
+    if (path[i]->cs_count <= 0)
       return true;
   return false;
 }
@@ -759,7 +759,7 @@ circuit (block_info *v, arc_vector_t &path, block_info *start,
     {
       block_info *w = arc->dst;
       if (w < start
-         || arc->cs_count == 0
+         || arc->cs_count <= 0
          || !linfo.has_block (w))
        continue;
 
@@ -770,7 +770,7 @@ circuit (block_info *v, arc_vector_t &path, block_info *start,
          handle_cycle (path, count);
          loop_found = true;
        }
-      else if (!path_contains_zero_cycle_arc (path)
+      else if (!path_contains_zero_or_negative_cycle_arc (path)
               &&  find (blocked.begin (), blocked.end (), w) == blocked.end ())
        loop_found |= circuit (w, path, start, blocked, block_lists, linfo,
                               count);
@@ -785,7 +785,7 @@ circuit (block_info *v, arc_vector_t &path, block_info *start,
       {
        block_info *w = arc->dst;
        if (w < start
-           || arc->cs_count == 0
+           || arc->cs_count <= 0
            || !linfo.has_block (w))
          continue;
 
@@ -923,7 +923,7 @@ static void
 print_version (void)
 {
   fnotice (stdout, "gcov %s%s\n", pkgversion_string, version_string);
-  fprintf (stdout, "Copyright %s 2019 Free Software Foundation, Inc.\n",
+  fprintf (stdout, "Copyright %s 2020 Free Software Foundation, Inc.\n",
           _("(C)"));
   fnotice (stdout,
           _("This is free software; see the source for copying conditions.\n"
@@ -1061,10 +1061,10 @@ output_intermediate_json_line (json::array *object,
     return;
 
   json::object *lineo = new json::object ();
-  lineo->set ("line_number", new json::number (line_num));
+  lineo->set ("line_number", new json::integer_number (line_num));
   if (function_name != NULL)
     lineo->set ("function_name", new json::string (function_name));
-  lineo->set ("count", new json::number (line->count));
+  lineo->set ("count", new json::integer_number (line->count));
   lineo->set ("unexecuted_block",
              new json::literal (line->has_unexecuted_block));
 
@@ -1079,7 +1079,7 @@ output_intermediate_json_line (json::array *object,
        if (!(*it)->is_unconditional && !(*it)->is_call_non_return)
          {
            json::object *branch = new json::object ();
-           branch->set ("count", new json::number ((*it)->count));
+           branch->set ("count", new json::integer_number ((*it)->count));
            branch->set ("throw", new json::literal ((*it)->is_throw));
            branch->set ("fallthrough",
                         new json::literal ((*it)->fall_through));
@@ -1138,16 +1138,19 @@ output_json_intermediate_file (json::array *json_files, source_info *src)
       function->set ("name", new json::string ((*it)->m_name));
       function->set ("demangled_name",
                     new json::string ((*it)->get_demangled_name ()));
-      function->set ("start_line", new json::number ((*it)->start_line));
-      function->set ("start_column", new json::number ((*it)->start_column));
-      function->set ("end_line", new json::number ((*it)->end_line));
-      function->set ("end_column", new json::number ((*it)->end_column));
+      function->set ("start_line",
+                    new json::integer_number ((*it)->start_line));
+      function->set ("start_column",
+                    new json::integer_number ((*it)->start_column));
+      function->set ("end_line", new json::integer_number ((*it)->end_line));
+      function->set ("end_column",
+                    new json::integer_number ((*it)->end_column));
       function->set ("blocks",
-                    new json::number ((*it)->get_block_count ()));
+                    new json::integer_number ((*it)->get_block_count ()));
       function->set ("blocks_executed",
-                    new json::number ((*it)->blocks_executed));
+                    new json::integer_number ((*it)->blocks_executed));
       function->set ("execution_count",
-                    new json::number ((*it)->blocks[0].count));
+                    new json::integer_number ((*it)->blocks[0].count));
 
       functions->append (function);
     }