1 /* Support for virtual clones in symbol table.
2 Copyright (C) 2003-2022 Free Software Foundation, Inc.
3 Contributed by Jan Hubicka
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
23 #include "coretypes.h"
30 #include "alloc-pool.h"
32 #include "symbol-summary.h"
33 #include "symtab-clones.h"
34 #include "lto-streamer.h"
35 #include "data-streamer.h"
39 /* Function summary for clone_infos. */
40 class GTY((user
)) clone_infos_t
: public function_summary
<clone_info
*>
43 clone_infos_t (symbol_table
*table
, bool ggc
):
44 function_summary
<clone_info
*> (table
, ggc
) { }
47 } /* anon namespace */
49 /* Return thunk_info possibly creating new one. */
51 clone_info::get_create (cgraph_node
*node
)
53 if (!symtab
->m_clones
)
56 = new (ggc_alloc_no_dtor
<function_summary
<clone_info
*>> ())
57 function_summary
<clone_info
*> (symtab
, true);
58 symtab
->m_clones
->disable_insertion_hook ();
59 symtab
->m_clones
->disable_duplication_hook ();
61 return symtab
->m_clones
->get_create (node
);