]> gcc.gnu.org Git - gcc.git/commitdiff
lto.c (cmp_type_location): Remove.
authorJan Hubicka <jh@suse.cz>
Thu, 22 Nov 2018 23:00:43 +0000 (00:00 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 22 Nov 2018 23:00:43 +0000 (23:00 +0000)
* lto.c (cmp_type_location): Remove.
(lto_read_decls): Do not allocate odr_types.

From-SVN: r266395

gcc/lto/ChangeLog
gcc/lto/lto.c

index 4731e3f33b9fbb57a5d26860118c64af694eb496..56f8a9867a97657d966c1ff9c0a8a1d289e65735 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-22  Jan Hubicka  <jh@suse.cz>
+
+       * lto.c (cmp_type_location): Remove.
+       (lto_read_decls): Do not allocate odr_types.
+
 2018-11-19  Martin Liska  <mliska@suse.cz>
 
        PR lto/88077
index 2d52d4a8f4e34affef63c5221ba449906b355ad7..a5195fdd5570b318658e61f1ca3eb359850b988c 100644 (file)
@@ -1712,36 +1712,6 @@ unify_scc (struct data_in *data_in, unsigned from,
 }
 
 
-/* Compare types based on source file location.  */
-
-static int
-cmp_type_location (const void *p1_, const void *p2_)
-{
-  tree *p1 = (tree*)(const_cast<void *>(p1_));
-  tree *p2 = (tree*)(const_cast<void *>(p2_));
-  if (*p1 == *p2)
-    return 0;
-
-  tree tname1 = TYPE_NAME (*p1);
-  tree tname2 = TYPE_NAME (*p2);
-  expanded_location xloc1 = expand_location (DECL_SOURCE_LOCATION (tname1));
-  expanded_location xloc2 = expand_location (DECL_SOURCE_LOCATION (tname2));
-
-  const char *f1 = lbasename (xloc1.file);
-  const char *f2 = lbasename (xloc2.file);
-  int r = strcmp (f1, f2);
-  if (r == 0)
-    {
-      int l1 = xloc1.line;
-      int l2 = xloc2.line;
-      if (l1 != l2)
-       return l1 - l2;
-      return xloc1.column - xloc2.column;
-    }
-  else
-    return r;
-}
-
 /* Read all the symbols from buffer DATA, using descriptors in DECL_DATA.
    RESOLUTIONS is the set of symbols picked by the linker (read from the
    resolution file when the linker plugin is being used).  */
@@ -1758,7 +1728,6 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
   unsigned int i;
   const uint32_t *data_ptr, *data_end;
   uint32_t num_decl_states;
-  auto_vec<tree> odr_types;
 
   lto_input_block ib_main ((const char *) data + main_offset,
                           header->main_size, decl_data->mode_table);
@@ -1828,7 +1797,7 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
                  if (!TYPE_CANONICAL (t))
                    gimple_register_canonical_type (t);
                  if (TYPE_MAIN_VARIANT (t) == t && odr_type_p (t))
-                   odr_types.safe_push (t);
+                   register_odr_type (t);
                }
              /* Link shared INTEGER_CSTs into TYPE_CACHED_VALUEs of its
                 type which is also member of this SCC.  */
@@ -1890,15 +1859,6 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
       *slot = state;
     }
 
-  /* Sort types for the file before registering in ODR machinery.  */
-  if (lto_location_cache::current_cache)
-    lto_location_cache::current_cache->apply_location_cache ();
-  odr_types.qsort (cmp_type_location);
-
-  /* Register ODR types.  */
-  for (unsigned i = 0; i < odr_types.length (); i++)
-    register_odr_type (odr_types[i]);
-
   if (data_ptr != data_end)
     internal_error ("bytecode stream: garbage at the end of symbols section");
 
This page took 0.069089 seconds and 5 git commands to generate.