| 1 |
/* Support for virtual clones in symbol table. |
| 2 |
Copyright (C) 2003-2025 Free Software Foundation, Inc. |
| 3 |
Contributed by Jan Hubicka |
| 4 |
|
| 5 |
This file is part of GCC. |
| 6 |
|
| 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 |
| 10 |
version. |
| 11 |
|
| 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 |
| 15 |
for more details. |
| 16 |
|
| 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/>. */ |
| 20 |
|
| 21 |
#include "config.h" |
| 22 |
#include "system.h" |
| 23 |
#include "coretypes.h" |
| 24 |
#include "backend.h" |
| 25 |
#include "tree.h" |
| 26 |
#include "gimple.h" |
| 27 |
#include "predict.h" |
| 28 |
#include "target.h" |
| 29 |
#include "rtl.h" |
| 30 |
#include "alloc-pool.h" |
| 31 |
#include "cgraph.h" |
| 32 |
#include "symbol-summary.h" |
| 33 |
#include "symtab-clones.h" |
| 34 |
#include "lto-streamer.h" |
| 35 |
#include "data-streamer.h" |
| 36 |
|
| 37 |
namespace { |
| 38 |
|
| 39 |
/* Function summary for clone_infos. */ |
| 40 |
class GTY((user)) clone_infos_t: public function_summary <clone_info *> |
| 41 |
{ |
| 42 |
public: |
| 43 |
clone_infos_t (symbol_table *table, bool ggc): |
| 44 |
function_summary<clone_info *> (table, ggc) { } |
| 45 |
}; |
| 46 |
|
| 47 |
} /* anon namespace */ |
| 48 |
|
| 49 |
/* Return thunk_info possibly creating new one. */ |
| 50 |
clone_info * |
| 51 |
clone_info::get_create (cgraph_node *node) |
| 52 |
{ |
| 53 |
if (!symtab->m_clones) |
| 54 |
{ |
| 55 |
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 (); |
| 60 |
} |
| 61 |
return symtab->m_clones->get_create (node); |
| 62 |
} |