]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/symtab-clones.h
Update copyright years.
[thirdparty/gcc.git] / gcc / symtab-clones.h
CommitLineData
ae7a23a3 1/* Representation of adjustment made to virtual clones in the symbol table.
99dee823 2 Copyright (C) 2003-2021 Free Software Foundation, Inc.
ae7a23a3
JH
3 Contributed by Jan Hubicka
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_SYMTAB_CLONES_H
22#define GCC_SYMTAB_CLONES_H
23
24struct GTY(()) clone_info
25{
26 /* Constructor. */
27 clone_info ()
28 : tree_map (NULL),
29 param_adjustments (NULL),
30 performed_splits (NULL)
31 {
32 }
33 /* Constants discovered by IPA-CP, i.e. which parameter should be replaced
34 with what. */
35 vec<ipa_replace_map *, va_gc> *tree_map;
36 /* Parameter modification that IPA-SRA decided to perform. */
37 ipa_param_adjustments *param_adjustments;
38 /* Lists of dummy-decl and offset pairs representing split formal parameters
39 in the caller. Offsets of all new replacements are enumerated, those
40 coming from the same original parameter have the same dummy decl stored
41 along with them.
42
43 Dummy decls sit in call statement arguments followed by new parameter
44 decls (or their SSA names) in between (caller) clone materialization and
45 call redirection. Redirection then recognizes the dummy variable and
46 together with the stored offsets can reconstruct what exactly the new
47 parameter decls represent and can leave in place only those that the
48 callee expects. */
49 vec<ipa_param_performed_split, va_gc> *performed_splits;
50
51 /* Return clone_info, if available. */
52 static clone_info *get (cgraph_node *node);
53
54 /* Return clone_info possibly creating new one. */
55 static clone_info *get_create (cgraph_node *node);
56
57 /* Remove clone_info. */
58 static void remove (cgraph_node *node);
59
60 /* Release all clone_infos. */
61 static void release (void);
62};
63
64/* Return clone_info, if available. */
65inline clone_info *
66clone_info::get (cgraph_node *node)
67{
68 if (!symtab->m_clones)
69 return NULL;
70 return symtab->m_clones->get (node);
71}
72
73
74/* Remove clone_info association for NODE. */
75inline void
76clone_info::remove (cgraph_node *node)
77{
78 symtab->m_clones->remove (node);
79}
80
81/* Free clone info summaries. */
82inline void
83clone_info::release ()
84{
85 if (symtab->m_clones)
86 delete (symtab->m_clones);
87 symtab->m_clones = NULL;
88}
89
90#endif /* GCC_SYMTAB_CLONES_H */