7da17dd7bea40714bdc3ace7d25359dd01ae4e39
[libfirm] / ir / common / firm.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/common/firm.h
4  * Purpose:     Central firm header.
5  * Author:      Martin Trapp, Christian Schaefer
6  * Modified by: Goetz Lindenmaier
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 1998-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 /**
14  @file firm.h
15
16  This documentation no more  maintained since 2001!!!
17
18     Central FIRM header.
19
20     FIRM is a full graph based intermediate representation in SSA Form
21     with a novel concept to model side effects.  It allows fast, aggressive
22     optimizations.
23
24     This header is the central header of the library implementation of this
25     IR.
26
27     The internal representation of a program in firm is separated into five
28     different modules:
29      - Firm Graphs representing the code of a program. (Subdirectory ir.)
30        Firm Graphs are assembled out of several data structures:
31        irprog: represents a program.  Allows access to all types and all
32          FIRM graphs for procedures and other global things.
33        irgraph: represents a procedure.  Allows access to the code of the
34          procedure, the actual FIRM graph.
35        irnode: A node of a FIRM graph.  Nodes are typed with an opcode and a mode
36          and represent instructions in a program.
37        irop: The opcode of FIRM nodes.
38        irmode: The mode of FIRM nodes.  Most modes correspond to machine known
39          data types (int, float, pointer).
40      - Entities representing program known objects. (Subdirectory tr.)
41        All variables and procedures are entities.
42      - Types describing the type system for the program. (Subdirectory tr.)
43      - Target Values representing program known constants. (Subdirectory tv.)
44      - Identifiers representing any Strings used in the program. (Subdirectory ident.)
45
46      Further this library supplies functionality to build and optimize FIRM graphs
47      and further functionality needed in a compiler.  Finally there is more
48      generic functionality to support implementations using firm.  (Code generation,
49      further optimizations).
50
51      ircons: Interface to construct firm graphs, implements automatic Phi node
52        construction.
53      iropt: Optimizations applied to individual nodes.
54      irgopt: Optimizations for ir graphs.
55
56      irflag: Flags to direct the functionality.
57      common: dynamic typ check for all nodes,  configuration of the library,
58      debug:  ???
59
60      irgwalk: walker for ir graphs.
61      irvrfy:  verify the correctness of a firm node.
62 *
63 */
64
65 /* $Id$ */
66
67 # ifndef _FIRM_H_
68 # define _FIRM_H_
69
70 /* The representations */
71 # include "firm_common.h"/* common type tags. */
72 # include "irprog.h"     /* control flow and data of a program */
73 # include "type.h"       /* type representation */
74 # include "entity.h"     /* entity representation */
75 # include "tv.h"         /* target values */
76 # include "ident.h"      /* source code identificators */
77 /* Functionality */
78 # include "ircons.h"     /* construct ir */
79 # include "ircgcons.h"   /* construct interprocedural graph */
80
81 # include "irflag.h"     /* optimization flags */
82 # include "irgopt.h"     /* optimize ir */
83 # include "ircgopt.h"    /* Optimizations based on interprocedural graph */
84
85 # include "irdom.h"      /* Dominator analysis */
86 # include "cgana.h"      /* Analysis to construct interprocedural graph */
87                          /* including some optimizations */
88 # include "irloop.h"     /* loop and backedge analysis */
89
90 # include "irgmod.h"     /* Support to modify ir */
91 # include "irgwalk.h"    /* Support to walk ir */
92 # include "typewalk.h"   /* Support to walk type information */
93 # include "typegmod.h"   /* Support to modify type graph */
94 # include "mangle.h"     /* Support for mangling ident names. */
95
96 /* @@@ temporarily for jni builder until preprocessor works.
97    Then it should be sufficient to include <file.h> instead
98    of firm.h as not all enums are needed in the impelmentation
99    files. */
100 # include "irdump.h"
101
102 /**
103  * Initialize the firm library.
104  *
105  * @param func    This function is called, whenever a local variable is used before definition
106  *
107  * The parameter func may be NULL. In that case, the old FIRM behavior is conserved.
108  *
109  * @see default_initialize_local_variable_func_t
110  */
111 void init_firm (default_initialize_local_variable_func_t *func);
112
113 # endif /* _FIRM_H_ */