1169689Skan/* IPA handling of references.
2169689Skan   Copyright (C) 2004-2005 Free Software Foundation, Inc.
3169689Skan   Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
4169689Skan
5169689SkanThis file is part of GCC.
6169689Skan
7169689SkanGCC is free software; you can redistribute it and/or modify it under
8169689Skanthe terms of the GNU General Public License as published by the Free
9169689SkanSoftware Foundation; either version 2, or (at your option) any later
10169689Skanversion.
11169689Skan
12169689SkanGCC is distributed in the hope that it will be useful, but WITHOUT ANY
13169689SkanWARRANTY; without even the implied warranty of MERCHANTABILITY or
14169689SkanFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15169689Skanfor more details.
16169689Skan
17169689SkanYou should have received a copy of the GNU General Public License
18169689Skanalong with GCC; see the file COPYING.  If not, write to the Free
19169689SkanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20169689Skan02110-1301, USA.  */
21169689Skan
22169689Skan#ifndef GCC_IPA_REFERENCE_H
23169689Skan#define GCC_IPA_REFERENCE_H
24169689Skan#include "bitmap.h"
25169689Skan#include "tree.h"
26169689Skan
27169689Skan/* The static variables defined within the compilation unit that are
28169689Skan   loaded or stored directly by function that owns this structure.  */
29169689Skan
30169689Skanstruct ipa_reference_local_vars_info_d
31169689Skan{
32169689Skan  bitmap statics_read;
33169689Skan  bitmap statics_written;
34169689Skan
35169689Skan  /* Set when this function calls another function external to the
36169689Skan     compilation unit or if the function has a asm clobber of memory.
37169689Skan     In general, such calls are modeled as reading and writing all
38169689Skan     variables (both bits on) but sometime there are attributes on the
39169689Skan     called function so we can do better.  */
40169689Skan  bool calls_read_all;
41169689Skan  bool calls_write_all;
42169689Skan};
43169689Skan
44169689Skanstruct ipa_reference_global_vars_info_d
45169689Skan{
46169689Skan  bitmap statics_read;
47169689Skan  bitmap statics_written;
48169689Skan  bitmap statics_not_read;
49169689Skan  bitmap statics_not_written;
50169689Skan};
51169689Skan
52169689Skan/* Statics that are read and written by some set of functions. The
53169689Skan   local ones are based on the loads and stores local to the function.
54169689Skan   The global ones are based on the local info as well as the
55169689Skan   transitive closure of the functions that are called.  The
56169689Skan   structures are separated to allow the global structures to be
57169689Skan   shared between several functions since every function within a
58169689Skan   strongly connected component will have the same information.  This
59169689Skan   sharing saves both time and space in the computation of the vectors
60169689Skan   as well as their translation from decl_uid form to ann_uid
61169689Skan   form.  */
62169689Skan
63169689Skantypedef struct ipa_reference_local_vars_info_d *ipa_reference_local_vars_info_t;
64169689Skantypedef struct ipa_reference_global_vars_info_d *ipa_reference_global_vars_info_t;
65169689Skan
66169689Skanstruct ipa_reference_vars_info_d
67169689Skan{
68169689Skan  ipa_reference_local_vars_info_t local;
69169689Skan  ipa_reference_global_vars_info_t global;
70169689Skan};
71169689Skan
72169689Skantypedef struct ipa_reference_vars_info_d *ipa_reference_vars_info_t;
73169689Skan
74169689Skan/* In ipa-reference.c  */
75169689Skanbitmap ipa_reference_get_read_local (tree fn);
76169689Skanbitmap ipa_reference_get_written_local (tree fn);
77169689Skanbitmap ipa_reference_get_read_global (tree fn);
78169689Skanbitmap ipa_reference_get_written_global (tree fn);
79169689Skanbitmap ipa_reference_get_not_read_global (tree fn);
80169689Skanbitmap ipa_reference_get_not_written_global (tree fn);
81169689Skan
82169689Skan#endif  /* GCC_IPA_REFERENCE_H  */
83169689Skan
84