PR c++/34912
[official-gcc.git] / gcc / ipa-reference.h
blob1800a8ca9b9fc5a25c455cd23a216ba09001f917
1 /* IPA handling of references.
2 Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
3 Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
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
10 version.
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.
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/>. */
21 #ifndef GCC_IPA_REFERENCE_H
22 #define GCC_IPA_REFERENCE_H
23 #include "bitmap.h"
24 #include "tree.h"
26 /* The static variables defined within the compilation unit that are
27 loaded or stored directly by function that owns this structure. */
29 struct ipa_reference_local_vars_info_d
31 bitmap statics_read;
32 bitmap statics_written;
34 /* Set when this function calls another function external to the
35 compilation unit or if the function has a asm clobber of memory.
36 In general, such calls are modeled as reading and writing all
37 variables (both bits on) but sometime there are attributes on the
38 called function so we can do better. */
39 bool calls_read_all;
40 bool calls_write_all;
43 struct ipa_reference_global_vars_info_d
45 bitmap statics_read;
46 bitmap statics_written;
47 bitmap statics_not_read;
48 bitmap statics_not_written;
51 /* Statics that are read and written by some set of functions. The
52 local ones are based on the loads and stores local to the function.
53 The global ones are based on the local info as well as the
54 transitive closure of the functions that are called. The
55 structures are separated to allow the global structures to be
56 shared between several functions since every function within a
57 strongly connected component will have the same information. This
58 sharing saves both time and space in the computation of the vectors
59 as well as their translation from decl_uid form to ann_uid
60 form. */
62 typedef struct ipa_reference_local_vars_info_d *ipa_reference_local_vars_info_t;
63 typedef struct ipa_reference_global_vars_info_d *ipa_reference_global_vars_info_t;
65 struct ipa_reference_vars_info_d
67 ipa_reference_local_vars_info_t local;
68 ipa_reference_global_vars_info_t global;
71 typedef struct ipa_reference_vars_info_d *ipa_reference_vars_info_t;
73 /* In ipa-reference.c */
74 bitmap ipa_reference_get_read_local (tree fn);
75 bitmap ipa_reference_get_written_local (tree fn);
76 bitmap ipa_reference_get_read_global (tree fn);
77 bitmap ipa_reference_get_written_global (tree fn);
78 bitmap ipa_reference_get_not_read_global (tree fn);
79 bitmap ipa_reference_get_not_written_global (tree fn);
81 #endif /* GCC_IPA_REFERENCE_H */