GCC Middle and Back End API Reference
tree-nested.h
Go to the documentation of this file.
1/* Header file for Nested function decomposition for GIMPLE.
2 Copyright (C) 2013-2024 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_TREE_NESTED_H
21#define GCC_TREE_NESTED_H
22
23extern tree build_addr (tree);
25extern void lower_nested_functions (tree);
26
28{
29public:
30 /* Constructor. */
32 : origin (NULL),
33 nested (NULL),
35 {
36 }
37 /* Copy constructor. We can not simply copy the structure,
38 because the linked lists would go wrong. However we should never
39 need that. */
45
46 /* Return nested_function_info, if available. */
47 static nested_function_info *get (cgraph_node *node);
48
49 /* Return nested_function_info possibly creating new one. */
51
52 /* Release all nested_function_infos. */
53 static void release (void);
54
55 /* For nested functions points to function the node is nested in. */
57 /* Points to first nested function, if any. */
59 /* Pointer to the next function with same origin, if any. */
61};
62
64extern void unnest_function (cgraph_node *node);
65
66/* If there are functions nested in NODE, return first one. */
67inline cgraph_node *
69{
71 return info ? info->nested : NULL;
72}
73
74/* Return next nested function (used to iterate from first_nested_function). */
75inline cgraph_node *
80
81/* Return origin of nested function (and NULL otherwise). */
82inline cgraph_node *
84{
86 return info ? info->origin : NULL;
87}
88
89#endif /* GCC_TREE_NESTED_H */
Definition tree-nested.h:28
nested_function_info()
Definition tree-nested.h:31
nested_function_info(const nested_function_info &)
Definition tree-nested.h:40
~nested_function_info()
Definition tree-nested.cc:95
cgraph_node * nested
Definition tree-nested.h:58
cgraph_node * origin
Definition tree-nested.h:56
cgraph_node * next_nested
Definition tree-nested.h:60
static nested_function_info * get(cgraph_node *node)
Definition tree-nested.cc:57
static void release(void)
Definition tree-nested.cc:120
static nested_function_info * get_create(cgraph_node *node)
Definition tree-nested.cc:66
union tree_node * tree
Definition coretypes.h:97
Definition cgraph.h:875
#define NULL
Definition system.h:50
#define gcc_unreachable()
Definition system.h:841
tree build_addr(tree)
Definition tree-nested.cc:284
cgraph_node * nested_function_origin(cgraph_node *node)
Definition tree-nested.h:83
void insert_field_into_struct(tree, tree)
Definition tree-nested.cc:293
cgraph_node * first_nested_function(cgraph_node *node)
Definition tree-nested.h:68
void maybe_record_nested_function(cgraph_node *node)
Definition tree-nested.cc:129
void unnest_function(cgraph_node *node)
Definition tree-nested.cc:79
void lower_nested_functions(tree)
Definition tree-nested.cc:3829
cgraph_node * next_nested_function(cgraph_node *node)
Definition tree-nested.h:76