Copyright (C) 1995, 1996 Markus Armbruster */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
*/
/* $Id$ */
# include <assert.h>
# include "firm_common.h"
-/****h* libfirm/ident
+/**
*
- * NAME
- * ident -- identifiers in the firm library
- * NOTES
+ * - identifiers in the firm library
* Identifiers are used in the firm library. This is the interface to it.
- ******
*/
/* Identifiers */
-/****s* ident/ident
+/**
*
- * NAME
- * ident - the abstract data type ident
- * SOURCE
+ * the abstract data type ident
*/
typedef const struct set_entry ident;
-/*****/
-/****f* ident/id_from_str
+/**
*
- * NAME
- * id_from_str - store a string and create an ident
- * SYNOPSIS
- * ident *id = id_from_str (const char *str, int len);
- * FUNCTION
+ * store a string and create an ident
* Stores a string in the ident module and returns a handle for the string.
* Copies the string.
- * INPUTS
- * str - the string (or whatever) which shall be stored
- * len - the length of the data in bytes
- * RESULT
- * id - a handle for the generated ident
- * SEE ALSO
- * id_to_str, id_to_strlen
- ***
+ * @param str - the string (or whatever) which shall be stored
+ * @param len - the length of the data in bytes
+ * @return id - a handle for the generated ident
+ * @see id_to_str, id_to_strlen
+ * @see
*/
INLINE ident *id_from_str (const char *str, int len);
-/****f* ident/id_to_str
+/**
*
- * NAME
- * id_to_str - return a string represented by an ident
- * SYNOPSIS
- * char *cp = id_to_str (ident *id);
- * FUNCTION
+ * return a string represented by an ident
* Returns the string cp represented by id. This string cp is not
* Null terminated! The string may not be changed.
- * INPUTS
- * id - the ident
- * RESULT
- * cp - a string
- * SEE ALSO
- * id_from_str, id_to_strlen
- ***
+ * @param id - the ident
+ * @return cp - a string
+ * @see id_from_str, id_to_strlen
+ * @see
*/
INLINE const char *id_to_str (ident *id);
-/****f* ident/id_to_strlen
+/**
*
- * NAME
- * id_to_strlen - return the length of a string represented by an ident
- * SYNOPSIS
- * int len = id_to_strlen (ident *id);
- * FUNCTION
+ * return the length of a string represented by an ident
* Returns the length of string represented by id.
- * INPUTS
- * id - the ident
- * RESULT
- * len - the length of the string
- * SEE ALSO
- * id_from_str, id_to_str
- ***
+ * @param id - the ident
+ * @return len - the length of the string
+ * @see id_from_str, id_to_str
+ * @see
*/
INLINE int id_to_strlen(ident *id);
-/****f* ident/id_is_suffix
+/**
*
- * NAME
*
- * SYNOPSIS
- * int id_is_prefix (ident *prefix, ident *id);
- * FUNCTION
* Returns true if prefix is prefix of id.
- * INPUTS
- * prefix - the prefix
- * id - the ident
- * SEE ALSO
- * id_from_str, id_to_str, id_is_prefix
- ***
+ * @param prefix - the prefix
+ * @param id - the ident
+ * @see id_from_str, id_to_str, id_is_prefix
+ * @see
*/
/* */
int id_is_prefix (ident *prefix, ident *id);
-/****f* ident/id_is_suffix
+/**
*
- * NAME
*
- * SYNOPSIS
- * int id_is_suffix (ident *suffix, ident *id);
- * FUNCTION
* Returns true if suffix is suffix of id.
- * INPUTS
- * suffix - the suffix
- * id - the ident
- * SEE ALSO
- * id_from_str, id_to_str, id_is_prefix
- ***
+ * @param suffix - the suffix
+ * @param id - the ident
+ * @see id_from_str, id_to_str, id_is_prefix
+ * @see
*/
/* */
int id_is_suffix (ident *suffix, ident *id);
-/****f* ident/print_id
+/**
*
- * NAME
*
- * SYNOPSIS
- * int print_id (ident *id);
- * FUNCTION
* Prints the ident to stdout.
- * INPUTS
- * The ident to print.
- * SEE ALSO
- * id_from_str, id_to_str, id_is_prefix, fprint_id
- ***
+ * @param The ident to print.
+ * @see id_from_str, id_to_str, id_is_prefix, fprint_id
+ * @see
*/
/* */
int print_id (ident *id);
-/****f* ident/fprint_id
+/**
*
- * NAME
*
- * SYNOPSIS
- * int fprint_id (FILE *f, ident *id);
- * FUNCTION
* Prints the ident to the file passed.
- * INPUTS
- * The ident to print and the file.
- * SEE ALSO
- * id_from_str, id_to_str, id_is_prefix, print_id
- ***
+ * @param The ident to print and the file.
+ * @see id_from_str, id_to_str, id_is_prefix, print_id
+ * @see
*/
/* */
int fprint_id (FILE *F, ident *id);
Copyright (C) 1995, 1996 Markus Armbruster */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** ircons.c: basic and more detailed irnode constructors
-** store, block and parameter administration.
-** Adapted to extended FIRM nodes (exceptions...) and commented
-** by Goetz Lindenmaier
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* ircons.c: basic and more detailed irnode constructors
+* store, block and parameter administration.
+* Adapted to extended FIRM nodes (exceptions...) and commented
+* by Goetz Lindenmaier
*/
/* $Id$ */
res->attr.io.ent = ent;
/* res = optimize (res);
- ** irn_vrfy (res); */
+ * irn_vrfy (res); */
return (res);
}
/** public interfaces */
/** construction tools */
-/****f* ircons/new_Start
+/**
*
- * NAME
- * new_Start -- create a new Start node in the current block
+ * - create a new Start node in the current block
*
- * SYNOPSIS
- * s = new_Start(void);
- * ir_node* new_Start(void);
+ * @return s - pointer to the created Start node
*
- * RESULT
- * s - pointer to the created Start node
*
- ****
*/
ir_node *
new_d_Start (dbg_info* db)
static ir_node *
get_r_value_internal (ir_node *block, int pos, ir_mode *mode);
-/** This function computes the predecessors for a real Phi node, and then
+/**
allocates and returns this node. The routine called to allocate the
node might optimize it away and return a real value, or even a pointer
to a deallocated Phi node on top of the obstack!
#else /* if 0 */
-/** This is the simple algorithm. If first generates a Phi0, then
+/**
it starts the recursion. This causes an Id at the entry of
every block that has no definition of the value! **/
}
#endif
-/** This function allocates a dummy Phi node to break recursions,
+/**
computes the predecessors for the real phi node, and then
allocates and returns this node. The routine called to allocate the
node might optimize it away and return a real value.
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer,
-** Goetz Lindenmaier
-**
-** ircons.h ir node construction
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer,
+* Goetz Lindenmaier
+*
+* ircons.h ir node construction
*/
/* $Id$ */
-/** !!!
-*** Ideas for imrovement:
-***
+/**
+* Ideas for imrovement:
+*
Handle construction of exceptions more comfortable:
Add new constructors that pass the exception region (or better the
Phi for the memories, the ex. region can be found from there) as parameter,
it is always unambiguous.
**/
-/****h* libfirm/ircons
+/**
*
- * NAME
* file ircons.h
*
- * NOTES
* This file documents all datatypes and constructors needed to
* build a FIRM representation of a pocedure. The constructors are
* also implemented in this file.
*
* For extensive documentation of FIRM see UKA Techreport 1999-14.
*
- * DATATYPES
* =========
*
* The struct ir_graph
* - the outputs of the Firm node
* - attributes to the node
*
- * BASIC BLOCKS
* ------------
*
* ir_node *new_immBlock (void)
* else it points to the end_block.
*
*
- * CONSTANTS
* ---------
*
* ir_node *new_Const (ir_mode *mode, tarval *con)
* attr.i.*ptrinfo, an ident holding information for the linker. The mode
* of the node is mode_P.
*
- * THE SELECT NODE
* ---------------
*
* ir_node *new_simpleSel (ir_node *store, ir_node *frame, entity *sel)
*
*
*
- * THE PHI NODE
* ------------
*
* In general, Phi nodes are automaitcally inserted. In some cases, if
* flow from Start to End. Adds the node to the list in the end
* node.
*
- *****
*/
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** irdump.h: dumping of an intermediate representation graph
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* irdump.h: dumping of an intermediate representation graph
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** dump an ir graph, for further use with xvcg
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* dump an ir graph, for further use with xvcg
*/
/* $Id$ */
# include "irnode.h"
# include "irgraph.h"
-/****h* libfirm/irdump
+/**
*
- * NAME
- * irdump -- dump routines for the graph and all type information
- * NOTES
+ * - dump routines for the graph and all type information
* The dump format of most functions is vcg. This is a text based graph
* representation. Some use the original format,
* but most generate an extended format that is only read by some special
* Most routines use the name of the passed entity as the name of the
* file dumped to.
*
- ******
*/
/* @@@ GL: A hack */
extern char *dump_file_suffix;
-/****m* irdump/dump_ir_graph
+/**
*
- * NAME
- * dump_ir_graph -- dump a firm graph
- * SYNOPSIS
- * void dump_ir_graph (ir_graph *irg);
- * FUNCTION
+ * - dump a firm graph
* Dumps all Firm nodes of a single graph for a single procedure in
* standard xvcg format.
* Dumps the graph to a file. The file name is constructed from the
* name of the entity describing the procedure (irg->entity) and the
* ending .vcg. Eventually overwrites existing files.
- * INPUTS
- * irg: The firm graph to be dumped.
- * RESULT
- * A file containing the firm graph in vcg format.
- * SEE ALSO
- * turn_of_edge_labels
- ***
+ * @param irg: The firm graph to be dumped.
+ * @return A file containing the firm graph in vcg format.
+ * @see turn_of_edge_labels
+ * @see
*/
void dump_ir_graph (ir_graph *irg);
-/****m* irdump/dump_ir_block_graph
+/**
*
- * NAME
- * dump_ir_block_graph -- dump a firm graph without explicit block nodes.
- * SYNOPSIS
- * void dump_ir_block_graph (ir_graph *irg);
- * FUNCTION
+ * - dump a firm graph without explicit block nodes.
* Dumps all Firm nodes of a single graph for a single procedure in
* extended xvcg format.
* Dumps the graph to a file. The file name is constructed from the
* name of the entity describing the procedure (irg->entity) and the
* ending .vcg. Eventually overwrites existing files.
- * INPUTS
- * irg: The firm graph to be dumped.
- * RESULT
- * A file containing the firm graph in vcg format.
- * SEE ALSO
- * turn_of_edge_labels
- ***
+ * @param irg: The firm graph to be dumped.
+ * @return A file containing the firm graph in vcg format.
+ * @see turn_of_edge_labels
+ * @see
*/
void dump_ir_block_graph (ir_graph *irg);
-/****m* irdump/dump_cfg
+/**
*
- * NAME
- * dump_cfg -- Dump the control flow graph of a procedure
- * SYNOPSIS
- * void dump_cfg (ir_graph *irg);
- * FUNCTION
+ * - Dump the control flow graph of a procedure
* Dumps the control flow graph of a procedure in standard xvcg format.
* Dumps the graph to a file. The file name is constructed from the
* name of the entity describing the procedure (irg->entity) and the
* ending -cfg.vcg. Eventually overwrites existing files.
- * INPUTS
- * irg: The firm graph whose CFG shall be dumped.
- * RESULT
- * A file containing the CFG in vcg format.
- * SEE ALSO
- * turn_of_edge_labels
- ***
+ * @param irg: The firm graph whose CFG shall be dumped.
+ * @return A file containing the CFG in vcg format.
+ * @see turn_of_edge_labels
+ * @see
*/
void dump_cfg (ir_graph *irg);
-/****m* irdump/dump_type_graph
+/**
*
- * NAME
- * dump_type_graph --
- * SYNOPSIS
- * void dump_type_graph (ir_graph *irg);
- * FUNCTION
+ * -
* Dumps all the type information needed for Calls, Sels, ... in this graph.
* Dumps this graph to a file. The file name is constructed from the
* name of the entity describing the procedure (irg->entity) and the
* ending -type.vcg. Eventually overwrites existing files.
- * INPUTS
- * irg: The firm graph whose type information is to be dumped.
- * RESULT
- * A file containing the type information of the firm graph in vcg format.
- * SEE ALSO
- * turn_of_edge_labels
- ***
+ * @param irg: The firm graph whose type information is to be dumped.
+ * @return A file containing the type information of the firm graph in vcg format.
+ * @see turn_of_edge_labels
+ * @see
*/
void dump_type_graph (ir_graph *irg);
-/****m* irdump/dump_all_types
+/**
*
- * NAME
- * dump_all_types -- Dumps all type information
- * SYNOPSIS
- * void dump_all_types (void);
- * FUNCTION
+ * - Dumps all type information
* Dumps all type information that is somehow reachable in standard vcg
* format.
* Dumps the graph to a file named All_types.vcg.
- * INPUTS
- * No inputs.
- * RESULT
- * A file containing all type information for the program in standard
- * vcg format.
- * SEE ALSO
- * turn_of_edge_labels
- ***
+ * @param No inputs.
+ * @return A file containing all type information for the program in standard
+ * @return vcg format.
+ * @see turn_of_edge_labels
+ * @see
*/
void dump_all_types (void);
-/****m* irdump/dump_class_hierarchy
+/**
*
- * NAME
- * dump_class_hierarchy -- Dumps the class hierarchy with or without entities.
- * SYNOPSIS
- * void dump_class_hierarchy (bool entities);
- * FUNCTION
+ * - Dumps the class hierarchy with or without entities.
* Dumps a node for all classes and the sub/supertype relations. If
* entities is set to true also dumps the entities of classes, but without
* any additional information as the entities type. The overwrites relation
* is dumped along with the entities.
* Dumps to a file class_hierarchy.vcg
- * INPUTS
- * Flag whether to dump the entities.
- * RESULT
- * A file containing the class hierarchy tree for the program in standard
- * vcg format.
- * SEE ALSO
- *
- ***
+ * @param Flag whether to dump the entities.
+ * @return A file containing the class hierarchy tree for the program in standard
+ * @return vcg format.
+ * @see
+ * @see
*/
void dump_class_hierarchy (bool entities);
-/****m* irdump/dump_ir_graph_w_types
+/**
*
- * NAME
* dump_ir_graph_w_types
- * SYNOPSIS
- * void dump_ir_graph_w_types (ir_graph *irg);
- * FUNCTION
* Dumps a firm graph and all the type information needed for Calls,
* Sels, ... in this graph.
* Dumps the graph to a file. The file name is constructed from the
* name of the entity describing the procedure (irg->entity) and the
* ending -all.vcg. Eventually overwrites existing files.
- * INPUTS
- * irg: The firm graph to be dumped with its type information.
- * RESULT
- * A file containing the firm graph and the type information of the firm graph in vcg format.
- * SEE ALSO
- * turn_of_edge_labels
- ***
+ * @param irg: The firm graph to be dumped with its type information.
+ * @return A file containing the firm graph and the type information of the firm graph in vcg format.
+ * @see turn_of_edge_labels
+ * @see
*/
void dump_ir_graph_w_types (ir_graph *irg);
- /****m* irdump/dump_ir_block_graph_w_types
+/**
*
- * NAME
* dump_ir_block_graph_w_types
- * SYNOPSIS
- * void dump_ir_block_graph_w_types (ir_graph *irg);
- * FUNCTION
* Dumps a firm graph and all the type information needed for Calls,
* Sels, ... in this graph. The graph is in blocked format.
* Dumps the graph to a file. The file name is constructed from the
* name of the entity describing the procedure (irg->entity) and the
* ending -all.vcg. Eventually overwrites existing files.
- * INPUTS
- * irg: The firm graph to be dumped with its type information.
- * RESULT
- * A file containing the firm graph and the type information of the firm graph in vcg format.
- * SEE ALSO
- * turn_of_edge_labels
- ***
+ * @param irg: The firm graph to be dumped with its type information.
+ * @return A file containing the firm graph and the type information of the firm graph in vcg format.
+ * @see turn_of_edge_labels
+ * @see
*/
void dump_ir_block_graph_w_types (ir_graph *irg);
-/****m* irdump/dump_cg_graph
+/**
*
- * NAME
* dump_cg_graph
- * SYNOPSIS
- * void dump_cg_graph (ir_graph *irg);
- * FUNCTION
* Dumps a interprocedural firm graph as dump_ir_graph.
- * INPUTS
- * irg: The firm graph to be dumped.
- * RESULT
- * A file containing the firm graph in vcg format.
- * SEE ALSO
- ***
+ * @param irg: The firm graph to be dumped.
+ * @return A file containing the firm graph in vcg format.
+ * @see
*/
void dump_cg_graph(ir_graph * irg);
-/****m* irdump/dump_cg_block_graph
+/**
*
- * NAME
* dump_cg_block_graph
- * SYNOPSIS
- * void dump_cg_block_graph (ir_graph *irg);
- * FUNCTION
* Dumps a interprocedural firm graph as dump_ir_block_graph.
- * INPUTS
- * irg: The firm graph to be dumped.
- * RESULT
- * A file containing the firm graph in vcg format.
- * SEE ALSO
- ***
+ * @param irg: The firm graph to be dumped.
+ * @return A file containing the firm graph in vcg format.
+ * @see
*/
void dump_cg_block_graph(ir_graph * irg);
void dump_all_cg_block_graph();
-/****m* irdump/dump_all_ir_graphs
+/**
*
- * NAME
- * dump_all_ir_graphs -- a walker that calls a dumper for each graph
- * SYNOPSIS
- * void dump_all_ir_graphs (void dump_graph(ir_graph*));
- * FUNCTION
+ * - a walker that calls a dumper for each graph
* Walks over all firm graphs and calls a dumper for each graph.
* The following dumpers can be passed as arguments:
* dump_ir_graph
* dump_cfg
* dump_type_graph
* dump_ir_graph_w_types
- * INPUTS
- * The dumper to be used for dumping.
- * RESULT
- * Whatever the dumper creates.
- * SEE ALSO
- * turn_of_edge_labels
- ***
+ * @param The dumper to be used for dumping.
+ * @return Whatever the dumper creates.
+ * @see turn_of_edge_labels
+ * @see
*/
typedef void (dump_graph_func)(ir_graph *);
void dump_all_ir_graphs (dump_graph_func *dump_graph);
-/****m* irdump/turn_off_edge_labels
+/**
*
- * NAME
* turn_off_edge_labels
- * SYNOPSIS
- * void turn_off_edge_labels();
- * FUNCTION
* Sets the vcg flag "display_edge_labels" to no. This is necessary
* as xvcg and aisee both fail to display graphs with self-edges if these
* edges have labes.
- * INPUTS
- * No inputs
- * RESULT
- * dumpers will generate vcg flags with a different header.
- * SEE ALSO
- *
- ***
+ * @param No inputs
+ * @return dumpers will generate vcg flags with a different header.
+ * @see
+ * @see
*/
void turn_off_edge_labels();
-/****m* irdump/dump_consts_local
+/**
*
- * NAME
* dump_consts_local
- * SYNOPSIS
- * void dump_consts_local(bool b);
- * FUNCTION
* If set to true constants will be replicated for every use. In non blocked
* view edges from constant to block are scipped. Vcg
* then layouts the graphs more compact, this makes them better readable.
* The flag is automatically and temporarily set to false if other
* edges are dumped, as outs, loop, ...
* Default setting: false.
- * INPUTS
- * RESULT
- * SEE ALSO
- *
- ***
+ * @see
+ * @see
*/
void dump_consts_local(bool b);
-/****m* irdump/turn_off_constant_entity_values
+/**
*
- * NAME
* turn_off_constant_entity_values
- * SYNOPSIS
- * void turn_off_constant_entity_values()
- * FUNCTION
* Turns off dumping the values of constant entities. Makes type graphs
* better readable.
- * INPUTS
- * No inputs
- * RESULT
- * SEE ALSO
- *
- ***
+ * @param No inputs
+ * @see
+ * @see
*/
void turn_off_constant_entity_values();
-/****m* irdump/dump_keepalive_edges
+/**
*
- * NAME
* dump_keepalive_edges
- * SYNOPSIS
- * void dump_keepalive_edges()
- * FUNCTION
* Turns on dumping the edges from the End node to nodes to be kept
* alive
- * INPUTS
- * No inputs
- * RESULT
- * SEE ALSO
- *
- ***
+ * @param No inputs
+ * @see
+ * @see
*/
void dump_keepalive_edges(bool b);
-/****m* irdump/dump_out_edges
+/**
*
- * NAME
* dump_out_edges
- * SYNOPSIS
- * void dump_out_edges()
- * FUNCTION
* Turns on dumping the out edges starting from the Start block in
* dump_ir_graph. To test the consistency of the out datastructure.
- * INPUTS
- * No inputs
- * RESULT
- * SEE ALSO
- *
- ***
+ * @param No inputs
+ * @see
+ * @see
*/
void dump_out_edges();
-/****m* irdump/dump_dominator_information
+/**
*
- * NAME
* dump_dominator_information
- * SYNOPSIS
- * void dump_dominator_information()
- * FUNCTION
* If this flag is set the dumper dumps edges to immediate dominator in cfg.
- * INPUTS
- * No inputs
- * RESULT
- * SEE ALSO
- *
- ***
+ * @param No inputs
+ * @see
+ * @see
*/
void dump_dominator_information();
-/****m* irdump/dump_loop_information
+/**
*
- * NAME
* dump_loop_information
- * SYNOPSIS
- * void dump_loop_information()
- * FUNCTION
* If this flag is set the dumper dumps loop nodes and edges from
* these nodes to the contained ir nodes.
* Can be turned off with dont_dump_loop_information().
* If the loops are interprocedural nodes can be missing.
- * INPUTS
- * No inputs
- * RESULT
- * SEE ALSO
- *
- ***
+ * @param No inputs
+ * @see
+ * @see
*/
void dump_loop_information();
void dont_dump_loop_information();
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer
-**
-** irflag --- optimization flags
+* All rights reserved.
+*
+* Authors: Christian Schaefer
+*
+* irflag --- optimization flags
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer
-**
-** irflag --- optimization flags
+* All rights reserved.
+*
+* Authors: Christian Schaefer
+*
+* irflag --- optimization flags
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** irgmod: ir graph modification
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* irgmod: ir graph modification
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** irgmod.h: ir graph modification
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* irgmod.h: ir graph modification
*/
/* $Id$ */
/* Coyright (C) 1998 - 2002 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Christian Schaefer, Goetz Lindenmaier, Sebastian Felis
-**
-** Optimizations for a whole ir graph, i.e., a procedure.
+* All rights reserved.
+*
+* Author: Christian Schaefer, Goetz Lindenmaier, Sebastian Felis
+*
+* Optimizations for a whole ir graph, i.e., a procedure.
*/
/* $Id$ */
if (called_graph == current_ir_graph) return;
- /** Part the Call node into two nodes. Pre_call collects the parameters of
+/**
the procedure and later replaces the Start node of the called graph.
Post_call is the old Call node and collects the results of the called
graph. Both will end up being a tuple. **/
pre_call = new_Tuple(5, in);
post_call = call;
- /** Part the block of the Call node into two blocks.
+/**
The new block gets the ins of the old block, pre_call and all its
predecessors and all Phi nodes. **/
part_block(pre_call);
/* The new end node will die, but the in array is not on the obstack ... */
free_End(end);
- /** Collect control flow from Return blocks to post_calls block. Replace
+/**
Return nodes by Jump nodes. **/
n_ret = 0;
for (i = 0; i < arity; i++) {
}
set_irn_in(post_bl, n_ret, cf_pred);
- /** Collect results from Return nodes to post_call. Post_call is
+/**
turned into a tuple. **/
turn_into_tuple(post_call, 4);
/* First the Memory-Phi */
free(res_pred);
free(cf_pred);
- /*** Correct the control flow to the end node.
+/**
If the exception control flow from the Call directly branched to the
end block we now have the following control flow predecessor pattern:
ProjX -> Tuple -> Jmp.
}
in = (ir_node **) malloc(max_preds * sizeof(ir_node *));
- /** Debug output **
+/**
printf(" working on "); DDMN(b);
for (i = 0; i < get_Block_n_cfgpreds(b); i++) {
pred = get_nodes_Block(get_Block_cfgpred(b, i));
printf(" removing pred %i ", i); DDMN(pred);
} else { printf(" Nothing to do for "); DDMN(pred); }
}
- ** end Debug output **/
+ * end Debug output **/
/** Fix the Phi nodes **/
phi = get_irn_link(b);
phi = get_irn_link(phi);
}
- /** Move Phi nodes from removed blocks to this one.
+/**
This happens only if merge between loop backedge and single loop entry. **/
for (k = 0; k < get_Block_n_cfgpreds(b); k++) {
pred = get_nodes_Block(get_Block_cfgpred(b, k));
/* Copyright (C) 1998 - 2001 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Christian Schaefer, Goetz Lindenmaier
-**
-** Optimizations for a whole ir graph, i.e., a procedure.
+* All rights reserved.
+*
+* Author: Christian Schaefer, Goetz Lindenmaier
+*
+* Optimizations for a whole ir graph, i.e., a procedure.
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-**
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+*
*/
/* $Id$ */
current_ir_graph = res;
add_irp_irg(res); /* remember this graph global. */
- /** Internal information for graph construction either held in the graph or
- *** initialized for each graph. **/
+/**
+ * initialized for each graph. **/
#if PRECISE_EXC_CONTEXT
res->n_loc = n_loc + 1 + 1; /* number of local variables that are never
dereferenced in this graph plus one for
res->ent = ent;
set_entity_irg(ent, res);
- /** A type that represents the stack frame. A class type so that it can
+/**
contain "inner" methods as in Pascal. **/
res->frame_type = new_type_class(mangle(get_entity_ident(ent),
id_from_str(FRAME_TP_SUFFIX, strlen(FRAME_TP_SUFFIX))));
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** irgraph.h: ir graph construction
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* irgraph.h: ir graph construction
*/
/* $Id$ */
typedef struct ir_graph ir_graph;
#endif
-/***** irgraph/irgraph
+/**
*
* NAME Datastructure that holds central information about a procedure
*
- * NOTE
- ** ir_graph *new_ir_graph (entity *ent, int params);
+ * ir_graph *new_ir_graph (entity *ent, int params);
* -------------------------------------------------
*
* This constructor generates the basic infrastructure needed to
* datastructure is used to build the Phi nodes and removed after
* completion of the graph. There is no path from end to start in the
* graph after calling ir_graph.
- * FIELDS
* pinned set to "pinned" if no global cse was performed on the graph.
* set to "floats" if global cse was performed (and during construction:
* did actually change something). Code placement is necessary.
- * SOURCE
*/
/* Global variable holding the current_ir_graph. This global variable
/* States of an ir_graph. */
/********************************************************************************/
-/** An ir_graph can have different states. These states represent the analysis
+/**
information associated with the graph. Optimizations invalidate these
states. **/
void inc_irg_block_visited(ir_graph *irg);
unsigned long get_irg_block_visited (ir_graph *irg);
void set_irg_block_visited(ir_graph *irg, unsigned long i);
-/*****/
# endif /* _IRGRAPH_H_ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** irgraph.h: ir graph construction
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* irgraph.h: ir graph construction
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Boris Boesler
-**
-** traverse an ir graph
-** - execute the pre function before recursion
-** - execute the post function after recursion
+* All rights reserved.
+*
+* Author: Boris Boesler
+*
+* traverse an ir graph
+* - execute the pre function before recursion
+* - execute the post function after recursion
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Boris Boesler
-**
-** traverse an ir graph
-** - execute the pre function before recursion
-** - execute the post function after recursion
-**
-** Uses current_ir_graph (from irgraph.h)!!! Set it to the proper
-** graph before starting the walker.
+* All rights reserved.
+*
+* Author: Boris Boesler
+*
+* traverse an ir graph
+* - execute the pre function before recursion
+* - execute the post function after recursion
+*
+* Uses current_ir_graph (from irgraph.h)!!! Set it to the proper
+* graph before starting the walker.
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer
-**
+* All rights reserved.
+*
+* Authors: Christian Schaefer
+*
irmode.h Modes for ir operators.
This module specifies the modes that type the firm nodes. See
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer, Goetz Lindenmaier
-**
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer, Goetz Lindenmaier
+*
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe 3 2002/02/28 13:33:52
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** declarations of an ir node
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* declarations of an ir node
*/
/* $Id$ */
/* The type definiton of ir_node is also in irgraph.h to resolve
recursion between irnode.h and irgraph.h */
-/****s* irnode/irnode
+/**
*
* NAME ir_node - a datatype representing a Firm node
*
- * NOTE Not properly documented ;-)
+ * Not properly documented ;-)
*
- * ATTRIBUTES
- * The common fields are:
+ * @param The common fields are:
*
- * firm_kind A firm_kind tag containing k_type. This is useful
+ * @param firm_kind A firm_kind tag containing k_type. This is useful
* for dynamically checking whether a node is a ir_node.
- * arity The number of predecessors in the Firm graph.
- * in A list with the predecessors in the Firm graph. There are
+ * @param arity The number of predecessors in the Firm graph.
+ * @param in A list with the predecessors in the Firm graph. There are
* routines to access individual elements and to obtain the
* array. The method returning the array should not be used.
- * mode The mode of the node. There are routines to get the mode but
+ * @param mode The mode of the node. There are routines to get the mode but
* also to access the mode's fields directly.
- * opcode The opcode of the node. There are routines to get the opcode but
+ * @param opcode The opcode of the node. There are routines to get the opcode but
* also to access the opcode's fields directly.
- * node_nr A unique number for the node. Available only if debugging is
+ * @param node_nr A unique number for the node. Available only if debugging is
* turned on.
- * SOURCE
*/
#ifndef _IR_NODE_TYPEDEF_
#define _IR_NODE_TYPEDEF_
typedef struct ir_node ir_node;
#endif
-/** Manipulate the fields of ir_node. With these access routines
+/**
you can work on the graph without considering the different types
of nodes, it's just a big graph. **/
/* Returns the ir_graph this node belongs to. Only valid for
* CallBegin, EndReg and EndExcept */
INLINE ir_graph *get_irn_irg(ir_node *node);
-/*****/
/* irnode constructor */
/* Create a new irnode in irg, with an op, mode, arity and */
int arity,
ir_node *in[]);
-/****s* irnode/other
+/**
*
* NAME access functions for node fields.
*
- * NOTE Not properly documented ;-)
+ * Not properly documented ;-)
*
- * SOURCE
*/
/* this works for all except Block */
INLINE ir_node *get_Id_pred (ir_node *node);
INLINE void set_Id_pred (ir_node *node, ir_node *pred);
-/*****/
-/****s* irnode/other2
+/**
*
* NAME Auxiliary routines
*
- * NOTE Not properly documented ;-)
+ * Not properly documented ;-)
*
- * SOURCE
*/
/* returns operand of node if node is a Proj. */
/* Returns the memory operand of fragile operations. */
ir_node *get_fragile_op_mem(ir_node *node);
-/*****/
/* Makros for debugging the libfirm */
#include "ident.h"
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** declarations of an ir node
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* declarations of an ir node
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer
-**
+* All rights reserved.
+*
+* Authors: Christian Schaefer
+*
*/
/* $Id$ */
/*
-** Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer
-**
-** irop.h operators of firm nodes
-**
-** This module specifies the opcodes possible for ir nodes. Their
-** definition is close to the operations specified in UKA Tech-Report
-** 1999-14
-**
+* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
+* All rights reserved.
+*
+* Authors: Christian Schaefer
+*
+* irop.h operators of firm nodes
+*
+* This module specifies the opcodes possible for ir nodes. Their
+* definition is close to the operations specified in UKA Tech-Report
+* 1999-14
+*
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** iropt --- optimizations intertwined with IR construction.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* iropt --- optimizations intertwined with IR construction.
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** Declarations for optimizations intertwined with IR construction.
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* Declarations for optimizations intertwined with IR construction.
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
-** Declarations for optimizations intertwined with IR construction.
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
+* Declarations for optimizations intertwined with IR construction.
*/
/* $Id$ */
/* Copyright (C) 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** irprog.c: ir representation of a program
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* irprog.c: ir representation of a program
*/
/* $Id$ */
/* Copyright (C) 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** irprog.h: ir representation of a program
-**
-** This file defines a construct that keeps all information about a
-** program:
-** - A list of all procedures.
-** - A list of all types.
-** - A global type that can be thought of as a god-class containing all
-** global variables and procedures. This is not the base class of
-** all classes in a class hierarchy (as, e.g., "object" in java).
-** - (An obstack containing global things, e.g., the above mentioned lists.)
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* irprog.h: ir representation of a program
+*
+* This file defines a construct that keeps all information about a
+* program:
+* - A list of all procedures.
+* - A list of all types.
+* - A global type that can be thought of as a god-class containing all
+* global variables and procedures. This is not the base class of
+* all classes in a class hierarchy (as, e.g., "object" in java).
+* - (An obstack containing global things, e.g., the above mentioned lists.)
*/
/* $Id$ */
# include "irnode.h"
# include "type.h"
-/***** irprog/irprog
+/**
*
* NAME Datastructure that holds central information about a program
*
- * NOTE Preliminary documentation ;-)
+ * Preliminary documentation ;-)
*
- * SOURCE
*/
-/***s* irprog/irprog
+/**
*
* NAME Datastructure that holds central information about a program
*
- * NOTE Preliminary documentation ;-)
+ * Preliminary documentation ;-)
*
- * FIELDS
* main_irg The ir graph that is the entry point to the program.
* (Anything not reachable from here may be optimized away.
* If we want to translate libraries or the like correctly
* using exchange_types()).
* glob_type The unique global type that is owner of all global entities.
*
- * SOURCE
*/
typedef struct ir_prog ir_prog;
/** Functions to access the fields of ir_prog **/
type *get_glob_type(void);
-/*****/
-/***p* irprog/get_const_code_irg
+/**
*
- * NAME
- * get_const_code_irg - Returns an irgraph that only contains constant
+ * Returns an irgraph that only contains constant
* expressions for constant entities.
- * SYNOPSIS
- * ir_graph *get_const_code_irg();
- * NOTE
* Do not use any access function for this graph, do not generate code
* for this graph. This graph contains only one block. The constant
* expressions may not contain control flow. See also copy_const_code
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer
-**
-**
+* All rights reserved.
+*
+* Authors: Christian Schaefer
+*
+*
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Christian Schaefer
-**
-** irgraph.h: ir graph verification
+* All rights reserved.
+*
+* Author: Christian Schaefer
+*
+* irgraph.h: ir graph verification
*/
/* $Id$ */
/* Copyright (C) 2001 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** Some makros supporting old function names.
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* Some makros supporting old function names.
*/
/* $Id$ */
/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */
-/***
+/**
NAME
bs
PURPOSE
provide bs_t
- NOTES
+ S
not quite complete
HISTORY
liekweg - Feb 27, 2002: Created.
/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */
/*
-** Time-stamp: <Monday, 04.11.2002, 17:28:27 goetz@i44pc2.info.uni-karlsruhe.de>
+* Time-stamp: <Monday, 04.11.2002, 17:28:27 goetz@i44pc2.info.uni-karlsruhe.de>
*/
-/***
+/**
NAME
exc
PURPOSE
Helper functions for exceptions
- NOTES
+ S
not quite complete
HISTORY
liekweg - Mar 4, 2002: Created.
/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */
/*
-** Time-stamp: <Thursday, 19.12.2002, 15:45:43 goetz@i44pc2.info.uni-karlsruhe.de>
+* Time-stamp: <Thursday, 19.12.2002, 15:45:43 goetz@i44pc2.info.uni-karlsruhe.de>
*/
-/***
+/**
NAME
exc
PURPOSE
Helper functions for exceptions
- NOTES
+ S
not quite complete
HISTORY
liekweg - Mar 4, 2002: Created.
/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */
/*
-** Time-stamp: <Thursday, 31.10.2002, 16:03:00 goetz@i44pc2.info.uni-karlsruhe.de>
+* Time-stamp: <Thursday, 31.10.2002, 16:03:00 goetz@i44pc2.info.uni-karlsruhe.de>
*/
-/***
+/**
NAME
st.h
PURPOSE
provide some auxilliary structures for firm graphs.
- NOTES
+ S
not quite complete
HISTORY
liekweg - Feb 26, 2002: Created.
*/
/* --------------------------------------------------------------------
-** Helper Functions
-** -------------------------------------------------------------------- */
+* Helper Functions
+* -------------------------------------------------------------------- */
/*
Helper function for get_n_blocks
*/
*/
/* --------------------------------------------------------------------
-** Private Functions
-** -------------------------------------------------------------------- */
+* Private Functions
+* -------------------------------------------------------------------- */
/*
Given a graph, find its dominator tree in the global list:
}
/* --------------------------------------------------------------------
-** Public Functions
-** -------------------------------------------------------------------- */
+* Public Functions
+* -------------------------------------------------------------------- */
/*
Say wether a dominates b
/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */
-/***
+/**
NAME
st.h
PURPOSE
provide some auxilliary structures for firm graphs.
- NOTES
+ S
not quite complete
HISTORY
liekweg - Feb 26, 2002: Created.
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
*/
/* $Id$ */
/*
-** Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer,
-** Goetz Lindenmaier
-**
-** entity.h: entities represent all program known objects.
-**
-** An entity is the representation of program known objects in Firm.
-** The primary concept of entities is to represent members of complex
-** types, i.e., fields and methods of classes. As not all programming
-** language model all variables and methods as members of some class,
-** the concept of entities is extended to cover also local and global
-** variables, and arbitrary procedures.
-**
-** An entity always specifies the type of the object it represents and
-** the type of the object it is a part of, the owner of the entity.
-** Originally this is the type of the class of which the entity is a
-** member.
-** The owner of local variables is the procedure they are defined in.
-** The owner of global variables and procedures visible in the whole
-** program is a universally defined class type "GlobalType". The owner
-** of procedures defined in the scope of an other procedure is the
-** enclosing procedure.
-**
-** In detail the datastructure entity has the following fields:
-**
-** ident *name Name of this entity as specified in the source code.
-** Only unequivocal in conjuction with scope.
-** ident *ld_name Unique name of this entity, i.e., the mangled
-** name. E.g., for a class `A' with field `a' this
-** is the ident for `A_a'.
-** type *type The type of this entity, e.g., a method type, a
-** basic type of the language or a class itself.
-** type *owner; The class this entity belongs to. In case of local
-** variables the method they are defined in.
-** int offset; Offset in byte for this entity. Fixed when layout
-** of owner is determined.
-** ir_graph *irg; If (type == method_type) this is the corresponding irg.
-** The ir_graph constructor automatically sets this field.
-** If (type != method_type) access of this field will cause
-** an assertion.
+* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer,
+* Goetz Lindenmaier
+*
+* entity.h: entities represent all program known objects.
+*
+* An entity is the representation of program known objects in Firm.
+* The primary concept of entities is to represent members of complex
+* types, i.e., fields and methods of classes. As not all programming
+* language model all variables and methods as members of some class,
+* the concept of entities is extended to cover also local and global
+* variables, and arbitrary procedures.
+*
+* An entity always specifies the type of the object it represents and
+* the type of the object it is a part of, the owner of the entity.
+* Originally this is the type of the class of which the entity is a
+* member.
+* The owner of local variables is the procedure they are defined in.
+* The owner of global variables and procedures visible in the whole
+* program is a universally defined class type "GlobalType". The owner
+* of procedures defined in the scope of an other procedure is the
+* enclosing procedure.
+*
+* In detail the datastructure entity has the following fields:
+*
+* ident *name Name of this entity as specified in the source code.
+* Only unequivocal in conjuction with scope.
+* ident *ld_name Unique name of this entity, i.e., the mangled
+* name. E.g., for a class `A' with field `a' this
+* is the ident for `A_a'.
+* type *type The type of this entity, e.g., a method type, a
+* basic type of the language or a class itself.
+* type *owner; The class this entity belongs to. In case of local
+* variables the method they are defined in.
+* int offset; Offset in byte for this entity. Fixed when layout
+* of owner is determined.
+* ir_graph *irg; If (type == method_type) this is the corresponding irg.
+* The ir_graph constructor automatically sets this field.
+* If (type != method_type) access of this field will cause
+* an assertion.
*/
/* $Id$ */
typedef struct ir_graph ir_graph;
#endif
-/****s* entity/entity
+/**
*
- * NAME
- * entity - An abstract data type to represent program entites.
- * NOTE
+ * An abstract data type to represent program entites.
*
- * ATTRIBUTES
- * owner A compound type this entity is a part of.
- * type The type of this entity.
- * name The string that represents this entity in the source program.
- * allocation A flag saying whether the entity is dynamically or statically
+ * @param owner A compound type this entity is a part of.
+ * @param type The type of this entity.
+ * @param name The string that represents this entity in the source program.
+ * @param allocation A flag saying whether the entity is dynamically or statically
* allocated (values: dynamic_allocated, static_allocated,
* automatic_allocated).
- * visibility A flag indicating the visibility of this entity (values: local,
+ * @param visibility A flag indicating the visibility of this entity (values: local,
* external_visible, external_allocated)
- * variability A flag indicating the variability of this entity (values:
+ * @param variability A flag indicating the variability of this entity (values:
* uninitialized, initalized, part_constant, constant)
- * volatility @@@
- * offset The offset of the entity within the compound object. Only set
+ * @param volatility @@@
+ * @param offset The offset of the entity within the compound object. Only set
* if the owner in the state "layout_fixed".
- * overwrites A list of entities overwritten by this entity. This list is only
+ * @param overwrites A list of entities overwritten by this entity. This list is only
* existent if the owner of this entity is a class. The members in
* this list must be entities of super classes.
- * overwrittenby A list of entities that overwrite this entity. This list is only
+ * @param overwrittenby A list of entities that overwrite this entity. This list is only
* existent if the owner of this entity is a class. The members in
* this list must be entities of sub classes.
- * link A void* to associate some additional information with the entity.
- * irg If the entity is a method this is the ir graph that represents the
+ * @param link A void* to associate some additional information with the entity.
+ * @param irg If the entity is a method this is the ir graph that represents the
* code of the method.
- * peculiarity The peculiarity of the entity. If the entity is a method this
+ * @param peculiarity The peculiarity of the entity. If the entity is a method this
* indicates whether the entity represents
* a real method or whether it only exists to describe an interface.
* In that case there nowhere exists code for this entity and this entity
* is never dynamically used in the code.
* Values: description, existent. Default: existent.
- * visited visited flag. Master flag is type_visited.
+ * @param visited visited flag. Master flag is type_visited.
*
- * These fields can only be accessed via access functions.
+ * @param These fields can only be accessed via access functions.
*
- * SEE ALSO
- * type
- * SOURCE
+ * @see type
*/
/* to resolve recursion between entity.h and type.h */
void mark_entity_visited(entity *ent);
-/*****/
# endif /* _ENTITY_H_ */
/*10 2002/03/19 13:08:33
-** Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer,
-** Goetz Lindenmaier
-**
-** entity.h: entities represent all program known objects.
-**
-** An entity is the representation of program known objects in Firm.
-** The primary concept of entities is to represent members of complex
-** types, i.e., fields and methods of classes. As not all programming
-** language model all variables and methods as members of some class,
-** the concept of entities is extended to cover also local and global
-** variables, and arbitrary procedures.
-**
-** An entity always specifies the type of the object it represents and
-** the type of the object it is a part of, the owner of the entity.
-** Originally this is the type of the class of which the entity is a
-** member.
-** The owner of local variables is the procedure they are defined in.
-** The owner of global variables and procedures visible in the whole
-** program is a universally defined class type "GlobalType". The owner
-** of procedures defined in the scope of an other procedure is the
-** enclosing procedure.
-**
+* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer,
+* Goetz Lindenmaier
+*
+* entity.h: entities represent all program known objects.
+*
+* An entity is the representation of program known objects in Firm.
+* The primary concept of entities is to represent members of complex
+* types, i.e., fields and methods of classes. As not all programming
+* language model all variables and methods as members of some class,
+* the concept of entities is extended to cover also local and global
+* variables, and arbitrary procedures.
+*
+* An entity always specifies the type of the object it represents and
+* the type of the object it is a part of, the owner of the entity.
+* Originally this is the type of the class of which the entity is a
+* member.
+* The owner of local variables is the procedure they are defined in.
+* The owner of global variables and procedures visible in the whole
+* program is a universally defined class type "GlobalType". The owner
+* of procedures defined in the scope of an other procedure is the
+* enclosing procedure.
+*
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Martin Trapp, Christian Schaefer
-**
+* All rights reserved.
+*
+* Authors: Martin Trapp, Christian Schaefer
+*
*/
/* $Id$ */
/* Copyright (C) 2001 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
*/
/* $Id$ */
#include "ident.h"
-/****h* libfirm/tpop
+/**
*
- * NAME
* file tpop.h
- * COPYRIGHT
* (C) 2001 by Universitaet Karlsruhe
- * AUTHORS
* Goetz Lindenmaier
- * NOTES
* This module specifies the kinds of types available in firm. They are
* called type opcodes. These include classes, structs, methods, unions,
* arrays, enumerations, pointers and primitive types.
- *****
*/
-/****** tpop/typecode
+/**
*
- * NAME
- * typecode -- an enum for the type kinds
- * PURPOSE
+ * - an enum for the type kinds
* For each type kind exists a typecode to identify it.
- * SOURCE
*/
typedef enum {
tpo_class,
tpo_primitive,
tpo_id
} tp_opcode;
-/******/
-/****s* tpop/tp_op
+/**
*
- * NAME
- * tp_op - a structure containing information about a kind of type.
- * PURPOSE
+ * a structure containing information about a kind of type.
* A structure containing information about a kind of type. So far
* this is only the kind name, an enum for case-switching and some
* internal values.
- * SEE ALSO
- * get_tpop_name, get_tpop_code, get_tpop_ident
- * SOURCE
+ * @see get_tpop_name, get_tpop_code, get_tpop_ident
*/
typedef struct tp_op tp_op;
-/******/
-/****f* tpop/get_tpop_name
+/**
+ *
+ * Returns the string for the type opcode.
+ * @param op - The type opcode to get the string from.
+ * @return a string. (@@@ Null terminated???)
*
- * NAME
- * get_tpop_name - Returns the string for the type opcode.
- * SYNOPSIS
- * const char *get_tpop_name (tp_op *op)
- * INPUTS
- * op - The type opcode to get the string from.
- * RESULT
- * a string. (@@@ Null terminated???)
- ***
*/
const char *get_tpop_name (tp_op *op);
-/****f* tpop/get_tpop_code
+/**
+ *
+ * Returns an enum for the type opcode.
+ * @param op - The type opcode to get the enum from.
+ * @return the enum.
*
- * NAME
- * get_tpop_code - Returns an enum for the type opcode.
- * SYNOPSIS
- * tp_opcode get_tpop_code (tp_op *op);
- * INPUTS
- * op - The type opcode to get the enum from.
- * RESULT
- * the enum.
- ***
*/
tp_opcode get_tpop_code (tp_op *op);
-/****f* tpop/get_tpop_ident
+/**
+ *
+ * Returns the ident for the type opcode.
+ * @param op - The type opcode to get the ident from.
+ * @return The ident.
*
- * NAME
- * get_tpop_ident - Returns the ident for the type opcode.
- * SYNOPSIS
- * ident *get_tpop_ident (tp_op *op);
- * INPUTS
- * op - The type opcode to get the ident from.
- * RESULT
- * The ident.
- ***
*/
ident *get_tpop_ident (tp_op *op);
-/****d* tpop/type_class
+/**
+ *
*
- * NAME
- * type_class -
- * PURPOSE
* This type opcode marks that the corresponding type is a class type.
* Consequently the type refers to supertypes, subtypes and entities.
* Entities can be any fields, but also methods.
* @@@ value class or not???
- * NOTES
* This struct is dynamically allocated but constant for the lifetime
* of the library.
- * SOURCE
*/
extern tp_op *type_class;
tp_op *get_type_class();
-/******/
-/****d* tpop/type_struct
+/**
*
- * NAME
* type_struct
- * PURPOSE
* This type opcode marks that the corresponding type is a compound type
* as a struct in C. Consequently the type refers to a list of entities
* which may not be methods (but pointers to methods).
- * NOTES
* This struct is dynamically allocated but constant for the lifetime
* of the library.
- * SOURCE
*/
extern tp_op *type_struct;
tp_op *get_type_struct();
-/******/
-/****d* tpop/type_method
+/**
*
- * NAME
* type_method
- * PURPOSE
* This type opcode marks that the corresponding type is a method type.
* Consequently it refers to a list of arguments and results.
- * NOTES
* This struct is dynamically allocated but constant for the lifetime
* of the library.
- * SOURCE
*/
extern tp_op *type_method;
tp_op *get_type_method();
-/******/
-/****d* tpop/type_union
+/**
*
- * NAME
* type_union
- * PURPOSE
* This type opcode marks that the corresponding type is a union type.
* Consequently it refers to a list of unioned types.
- * NOTES
* This struct is dynamically allocated but constant for the lifetime
* of the library.
- * SOURCE
*/
extern tp_op *type_union;
tp_op *get_type_union();
-/******/
-/****d* tpop/type_array
+/**
*
- * NAME
* type_array
- * PURPOSE
* This type opcode marks that the corresponding type is an array type.
* Consequently it contains a list of dimensions (lower and upper bounds)
* and an element type.
- * NOTES
* This struct is dynamically allocated but constant for the lifetime
* of the library.
- * SOURCE
*/
extern tp_op *type_array;
tp_op *get_type_array();
-/******/
-/****d* tpop/type_enumeration
+/**
*
- * NAME
* type_enumeration
- * PURPOSE
* This type opcode marks that the corresponding type is an enumeration type.
* Consequently it contains a list of idents for the enumeration identifiers
* and a list of tarbet values that are the constants used to implement
* the enumerators.
- * NOTES
* This struct is dynamically allocated but constant for the lifetime
* of the library.
- * SOURCE
*/
extern tp_op *type_enumeration;
tp_op *get_type_enumeration();
-/******/
-/****d* tpop/type_pointer
+/**
*
- * NAME
* type_pointer
- * PURPOSE
* This type opcode marks that the corresponding type is a pointer type.
* It contains a reference to the type the pointer points to.
- * NOTES
* This struct is dynamically allocated but constant for the lifetime
* of the library.
- * SOURCE
*/
extern tp_op *type_pointer;
tp_op *get_type_pointer();
-/******/
-/****d* tpop/type_primitive
+/**
*
- * NAME
* type_primitive
- * PURPOSE
* This type opcode marks that the corresponding type is a primitive type.
* Primitive types are types that are directly mapped to target machine
* modes.
- * NOTES
* This struct is dynamically allocated but constant for the lifetime
* of the library.
- * SOURCE
*/
extern tp_op *type_primitive;
tp_op *get_type_primitive();
-/******/
-/****d* tpop/type_id
+/**
*
- * NAME
* type_id
- * PURPOSE
* This type opcode is an auxiliary opcode dedicated to support transformations
* of the type structure. If a type is changed to another type with another
* opcode the new type will be allocated with new memory. All nodes refering
* type_id. Two types are exchanged by a call to exchange_types.
* If a type_id is visible externally report this as bug. If it is assured that
* this never happens this extern variable can be moved to tpop_t.h.
- * NOTES
* This struct is dynamically allocated but constant for the lifetime
* of the library.
- * SOURCE
*/
extern tp_op *type_id;
tp_op *get_type_id();
-/******/
# endif /*_TYPEOP_H_ */
# include <stddef.h>
# include "tpop.h"
-/****h* libfirm/tpop_t.h
+/**
*
- * NAME
* file tpop_t.h
- * COPYRIGHT
* (C) 2001 by Universitaet Karlsruhe
- * AUTHORS
* Goetz Lindenmaier
- * NOTES
* This file contains the datatypes hidden in tpop.h.
- * SEE ALSO
- * tpop.h
- *****
+ * @see tpop.h
*/
struct tp_op {
size_t attr_size;
};
-/****f* tpop/new_tpop
+/**
*
- * NAME
- * new_tpop - Returns a new type opcode.
- * NOTE
+ * Returns a new type opcode.
* Allocates a new tp_op struct and initializes it's fields with
* the passed values. This function is only to be used during
* initialization of the library.
- * SYNOPSIS
- * tp_op * new_tpop (tp_opcode code, ident *name, size_t attr_size);
- * INPUTS
- * code - the enum for this type opcode.
- * name - an ident for the name of the type opcode.
- * attr_size - the size of the attributes necessary for a type with
+ * @param code - the enum for this type opcode.
+ * @param name - an ident for the name of the type opcode.
+ * @param attr_size - the size of the attributes necessary for a type with
* this opcode
- * RESULT
- * A new type opcode.
- ***
+ * @return A new type opcode.
+ *
*/
tp_op * new_tpop (tp_opcode code, ident *name, size_t attr_size);
-/****f* tpop/new_tpop
+/**
*
- * NAME
- * init_tpop - Initialize the tpop module.
- * NOTE
+ * Initialize the tpop module.
* Must be called during the initizlization of the library. Allocates
* opcodes and sets the globals that are external visible as specified
* in tpop.h.
- * SYNOPSIS
- * void init_tpop (void);
- * INPUTS
- * RESULT
- * SIDE EFFECTS
* Allocates opcodes for classes, struct, method, union, array,
* enumeration, pointer and primitive and sets the according values.
- ***
+ *
*/
void init_tpop (void);
-/****f* tpop/get_tpop_attr_size
+/**
*
- * NAME
- * get_tpop_attr_size - Returns the size of the attribute to this kind
+ * Returns the size of the attribute to this kind
* of type.
- * NOTE
* Internal feature.
- * SYNOPSIS
- * int get_tpop_attr_size (tp_op *op)
- * INPUTS
- * op - The type opcode to get the size for.
- * RESULT
- * The size of the attribute of types with this opcode.
- * SIDE EFFECTS
- ***
+ * @param op - The type opcode to get the size for.
+ * @return The size of the attribute of types with this opcode.
+ *
*/
int get_tpop_attr_size (tp_op *op);
-/****h* libfirm/type.c
+/**
*
- * NAME
* file type.c - implementation of the datastructure to hold
* type information.
- * COPYRIGHT
* (C) 2001 by Universitaet Karlsruhe
- * AUTHORS
* Martin Trapp, Christian Schaefer, Goetz Lindenmaier
*
- * NOTES
* This module supplies a datastructure to represent all types
* known in the compiled program. This includes types specified
* in the program as well as types defined by the language. In the
* on the level of the programming language, modes at the level of
* the target processor.
*
- * SEE ALSO
- * type_t.h type tpop
- *****
+ * @see type_t.h type tpop
*/
/* $Id$ */
assert(method);
if (method->type_op == type_method) return 1; else return 0;
}
-/*****/
/*******************************************************************/
/** TYPE_UNION **/
-/****h* libfirm/type6 2002/03/19 13:08:33
+/**
*
- * NAME
* file type.h - datastructure to hold type information.
- * COPYRIGHT
* (C) 2001 by Universitaet Karlsruhe
- * AUTHORS
* Goetz Lindenmaier
*
- * NOTES
* This module supplies a datastructure to represent all types
* known in the compiled program. This includes types specified
* in the program as well as types defined by the language. In the
* on the level of the programming language, modes at the level of
* the target processor.
*
- * SEE ALSO
- * tpop.h
- *****
+ * @see tpop.h
*/
/* $Id$ */
typedef struct ir_node ir_node;
#endif
-/****s* type/type
+/**
*
- * NAME
- * type - An abstract data type to represent types.
- * NOTE
+ * An abstract data type to represent types.
* This is the abstract data type with which any type known in the
* compiled program can be represented. This includes types specified
* in the program as well as types defined by the language. In the
* The following describes the common attributes. They can only be
* accessed by the functions given below.
*
- * ATTRIBUTES
- * The common fields are:
+ * @param The common fields are:
*
- * firm_kind A firm_kind tag containing k_type. This is useful
+ * @param firm_kind A firm_kind tag containing k_type. This is useful
* for dynamically checking whether a node is a type node.
- * type_op A tp_op specifying the kind of the type.
- * mode The mode to be used to represent the type on a machine.
+ * @param type_op A tp_op specifying the kind of the type.
+ * @param mode The mode to be used to represent the type on a machine.
* @@@ maybe not global field??
- * name An identifier specifying the name of the type. To be
+ * @param name An identifier specifying the name of the type. To be
* set by the frontend.
- * size The size of the type, i.e. an entity of this type will
+ * @param size The size of the type, i.e. an entity of this type will
* occupy size bytes in memory. In several cases this is
* determined when fixing the layout of this type (class,
* struct, union, array, enumeration).
- * state The state of the type. The state represents whether the
+ * @param state The state of the type. The state represents whether the
* layout of the type is undefined or fixed (values: layout_undefined
* or layout_fixed). Compound types can have an undefined
* layout. The layout of the basic types primitive and pointer
* and the size of the type must be set.
* A fixed layout for enumeration types means that each enumeration
* is associated with an implementation value.
- * visit A counter for walks of the type information.
- * link A void* to associate some additional information with the type.
+ * @param visit A counter for walks of the type information.
+ * @param link A void* to associate some additional information with the type.
*
- * These fields can only be accessed via access functions.
+ * @param These fields can only be accessed via access functions.
*
- * Depending on the value of type_op, i.e., depending on the kind of the
- * type the adt contains further attributes. These are documented below.
- * SEE ALSO
- * class, struct, method, union, array, enumeration, pointer, primitive
- * SOURCE
+ * @param Depending on the value of type_op, i.e., depending on the kind of the
+ * @param type the adt contains further attributes. These are documented below.
+ * @see class, struct, method, union, array, enumeration, pointer, primitive
*/
#ifndef _TYPE_TYPEDEF_
#define _TYPE_TYPEDEF_
void* get_type_link(type *tp);
void set_type_link(type *tp, void *l);
-/*****/
-/****v* type/visited
+/**
*
- * NAME
- * type_visited - visited flag to traverse the type information
- * PURPOSE
+ * visited flag to traverse the type information
* Increase this flag by one before traversing the type information.
* Mark type nodes as visited by set_type_visited(type, type_visited).
* Check whether node was already visited by comparing get_type_visited(type)
* and type_visited.
* Or use the function to walk all types.
- * SEE ALSO
- * typewalk
- * SOURCE
+ * @see typewalk
*/
extern unsigned long type_visited;
void set_master_type_visited(unsigned long val);
unsigned long get_master_type_visited();
void inc_master_type_visited();
-/*****/
-
-/****f* type/is_type
- *
- * NAME
- * is_type - Checks whether a pointer points to a type.
- * SYNOPSIS
- * bool is_type (void *thing);
- * INPUTS
- * thing - a pointer
- * RESULT
- * true if the thing is a type, else false
- ***
+
+/**
+ *
+ * Checks whether a pointer points to a type.
+ * @param thing - a pointer
+ * @return true if the thing is a type, else false
+ *
*/
int is_type (void *thing);
-/****f* type/equal_types
- *
- * NAME
- * equal_type - Checks whether two types are structural equal.
- * SYNOPSIS
- * bool equal_types (type *typ1, type *typ2);
- * INPUTS
- * two pointer types
- * RESULT
- * true if the types are equal, else false.
- * Types are equal if
+/**
+ *
+ * Checks whether two types are structural equal.
+ * @param two pointer types
+ * @return true if the types are equal, else false.
+ * @return Types are equal if
* - they are the same type kind
* - they have the same name
* - they have the same mode (if applicable)
* This is to avoid endless recursions; with pointer types circlic
* type graphs are possible.)
*
- ***
+ *
*/
bool equal_type(type *tpy1, type *typ2);
-/****f* type/smaller_type
- *
- * NAME
- * smaller_type - Checks whether two types are structural comparable.
- * SYNOPSIS
- * bool smaller_type (type *st, type *lt);
- * INPUTS
- * two pointer type
- * RESULT
- * true if type st is smaller than type lt, i.e. whenever
- * lt is expected a st can be used.
- * This is true if
+/**
+ *
+ * Checks whether two types are structural comparable.
+ * @param two pointer type
+ * @return true if type st is smaller than type lt, i.e. whenever
+ * @return lt is expected a st can be used.
+ * @return This is true if
* - they are the same type kind
* - mode(st) < mode (lt) (if applicable)
* - they are class types and st is (transitive) subtype of lt,
* - the parameter types of st are smaller than those of lt,
* - the result types of st are smaller than those of lt
* - they are union types and have the members of st have exactly one
- * counterpart in lt and the type is smaller
+ * @return counterpart in lt and the type is smaller
* - they are array types and have
* - the same number of dimensions
* - all bounds of lt are bound of st
* - the same dimension order
* - the same element type
- * or
+ * @return or
* - the element type of st is smaller than that of lt
* - the element types have the same size and fixed layout.
* - they are enumeration types and have the same enumerator names
* - they are pointer types and have the points_to type of st is
- * smaller than the points_to type of lt.
- ***
+ * @return smaller than the points_to type of lt.
+ *
*/
bool smaller_type (type *st, type *lt);
-/****** type/class
- * NAME
+/**
* Representation of a class type.
- * NOTE
* If the type opcode is set to type_class the type represents class
* types. A list of fields and methods is associated with a class.
* Further a class can inherit from and bequest to other classes.
* @@@ value class???
- * ATTRIBUTES
- * The following attributes are private to this type kind.
- * member All entities belonging to this class. This are methode entities
+ * @param The following attributes are private to this type kind.
+ * @param member All entities belonging to this class. This are methode entities
* which have type_method or fields that can have any of the
* following type kinds: type_class, type_struct, type_union,
* type_array, type_enumeration, type_pointer, type_primitive.
*
- * subtypes A list of direct subclasses.
+ * @param subtypes A list of direct subclasses.
*
- * supertypes A list of direct superclasses.
+ * @param supertypes A list of direct superclasses.
*
- * These are dynamic lists that can be grown with an "add_" function,
- * but not shrinked.
+ * @param These are dynamic lists that can be grown with an "add_" function,
+ * @param but not shrinked.
*
- * peculiarity The peculiarity of this class. If the class is of peculiarity
+ * @param peculiarity The peculiarity of this class. If the class is of peculiarity
* "description" it only is a description of requirememts to a class,
* as, e.g., a Java interface. The class will never be allocated.
* Peculiatity inherited is only possible for entities. An entity
* no value for irg.
* Values: description, existent, inherited. Default: existent.
*
- * SOURCE
*/
/* create a new class type */
type *new_type_class (ident *name);
bool is_class_type(type *clss);
/* Returns true if low is subclass of high. */
bool is_subclass_of(type *low, type *high);
-/*****/
-/****** type/struct
- * NAME
+/**
* Representation of a struct type.
- * NOTE
* Type_strct represents aggregate types that consist of a list
* of fields.
- * ATTRIBUTES
- * member All entities belonging to this class. This are the fields
+ * @param member All entities belonging to this class. This are the fields
* that can have any of the following types: type_class,
* type_struct, type_union, type_array, type_enumeration,
* type_pointer, type_primitive.
* but not shrinked.
* This is a dynamic list that can be grown with an "add_" function,
* but not shrinked.
- * SOURCE
*/
/* create a new type struct */
type *new_type_struct (ident *name);
/* typecheck */
bool is_struct_type(type *strct);
-/*****/
-/****** type/method
- * NAME
+/**
* Representation of a method type.
- * NOTE
* A method type represents a method, function or procedure type.
* It contains a list of the parameter and result types, as these
* are part of the type description. These lists should not
* be changed by a optimization, as a change creates a new method
* type. Therefore optimizations should allocated new method types.
* The set_ routines are only for construction by a frontend.
- * ATTRIBUTES
- * n_params Number of parameters to the procedure.
+ * @param n_params Number of parameters to the procedure.
* A procedure in FIRM has only call by value parameters.
*
- * param_type A list with the types of parameters. This list is ordered.
+ * @param param_type A list with the types of parameters. This list is ordered.
* The nth type in this list corresponds to the nth element
* in the parameter tuple that is a result of the start node.
* (See ircons.h for more information.)
*
- * n_res The number of results of the method. In general, procedures
+ * @param n_res The number of results of the method. In general, procedures
* have zero results, functions one.
*
- * res_type A list with the types of parameters. This list is ordered.
+ * @param res_type A list with the types of parameters. This list is ordered.
* The nth type in this list corresponds to the nth input to
* Return nodes. (See ircons.h for more information.)
- * SOURCE
*/
/* Create a new method type.
/* typecheck */
bool is_method_type (type *method);
-/*****/
-/****** type/union
- * NAME
+/**
* Representation of a union type.
- * NOTE
* The union type represents union types.
- * ATTRIBUTES
- * n_types Number of unioned types.
- * members Entities for unioned types. Fixed length array.
+ * @param n_types Number of unioned types.
+ * @param members Entities for unioned types. Fixed length array.
* This is a dynamic list that can be grown with an "add_" function,
* but not shrinked.
- * SOURCE
*/
/* create a new type union */
type *new_type_union (ident *name);
/* typecheck */
bool is_union_type (type *uni);
-/*****/
-/****** type/array
- * NAME
+/**
* Representation of an array type.
- * NOTE
* The array type represents rectangular multi dimensional arrays.
* The constants representing the bounds must be allocated to
* get_const_code_irg() by setting current_ir_graph accordingly.
- * ATTRIBUTES
- * n_dimensions Number of array dimensions.
- * *lower_bound Lower bounds of dimensions. Usually all 0.
- * *upper_bound Upper bounds or dimensions.
- * *element_type The type of the array elements.
- * *element_ent An entity for the array elements to be used for
+ * @param n_dimensions Number of array dimensions.
+ * @param *lower_bound Lower bounds of dimensions. Usually all 0.
+ * @param *upper_bound Upper bounds or dimensions.
+ * @param *element_type The type of the array elements.
+ * @param *element_ent An entity for the array elements to be used for
* element selection with Sel.
* @@@ Do we need several entities? One might want
* to select a dimension and not a single element in
* case of multidim arrays.
- * SOURCE
*/
/* create a new type array --
Sets n_dimension to dimension and all dimension entries to NULL.
/* typecheck */
bool is_array_type (type *array);
-/*****/
-/****** type/enumeration
- * NAME
+/**
* Representation of an enumeration type.
- * NOTE
* Enumeration types need not necessarily be represented explicitly
* by Firm types, as the frontend can lower them to integer constants as
* well. For debugging purposes or similar tasks this information is useful.
- * ATTRIBUTES
- * *enum The target values representing the constants used to
+ * @param *enum The target values representing the constants used to
* represent individual enumerations.
- * *enum_nameid Idents containing the source program name of the enumeration
+ * @param *enum_nameid Idents containing the source program name of the enumeration
* constants
*
-*****
*/
/* create a new type enumeration -- set the enumerators independently */
type *new_type_enumeration (ident *name, int n_enums);
/* typecheck */
bool is_enumeration_type (type *enumeration);
-/*****/
-/****** type/pointer
- * NAME
+/**
* Representation of a pointer type.
- * NOTE
* Pointer types.
- * ATTRIBUTES
- * points_to The type of the entity this pointer points to.
- * SOURCE
+ * @param points_to The type of the entity this pointer points to.
*/
/* Create a new type pointer */
type *new_type_pointer (ident *name, type *points_to);
/* typecheck */
bool is_pointer_type (type *pointer);
-/*****/
-/****** type/primitive
- * NAME
+/**
* Representation of a primitive type.
- * NOTE
* Primitive types are types that represent indivisible data values that
* map directly to modes. They don't have a private attribute. The
* important information they carry is held in the common mode field.
- * SOURCE
*/
/* create a new type primitive */
type *new_type_primitive (ident *name, ir_mode *mode);
/* typecheck */
bool is_primitive_type (type *primitive);
-/*****/
-/****f* type/is_atomic_type
+/**
+ *
+ * Checks whether a type is atomic.
+ * @param tp - any type
+ * @return true if type is primitive, pointer or enumeration
*
- * NAME
- * is_atomic_type - Checks whether a type is atomic.
- * SYNOPSIS
- * int is_atomic_type(type *tp);
- * INPUTS
- * tp - any type
- * RESULT
- * true if type is primitive, pointer or enumeration
- ***
*/
int is_atomic_type(type *tp);
-/****f* type/is_compound_type
- *
- * NAME
- * is_compound_type - Checks whether a type is compound.
- * SYNOPSIS
- * int is_compound_type(type *tp)
- * INPUTS
- * tp - any type
- * RESULT
- * true if the type is class, structure, union or array type.
- ***
+/**
+ *
+ * Checks whether a type is compound.
+ * @param tp - any type
+ * @return true if the type is class, structure, union or array type.
+ *
*/
int is_compound_type(type *tp);
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Goetz Lindenmaier
-**
+* All rights reserved.
+*
+* Author: Goetz Lindenmaier
+*
*/
/* $Id$ */
# include "type.h"
-/****h* libfirm/type_t.h
+/**
*
- * NAME
* file type_t.h
- * COPYRIGHT
* (C) 2001 by Universitaet Karlsruhe
- * AUTHORS
* Goetz Lindenmaier
- * NOTES
* This file contains the datatypes hidden in type.h.
- * SEE ALSO
- * type.h tpop_t.h tpop.h
- *****
+ * @see type.h tpop_t.h tpop.h
*/
typedef struct {
entry in this struct! Varying size! */
};
-/****f* type_t.h/new_type
+/**
+ *
+ * creates a new type representation
+ * @param type_op - the kind of this type. May not be type_id.
+ * @param mode - the mode to be used for this type, may be NULL
+ * @param name - an ident for the name of this type.
+ * @return a new type of the given type. The remaining private attributes are not
+ * @return initalized. The type is in state layout_undefined.
*
- * NAME
- * new_type - creates a new type representation
- * SYNOPSIS
- * type *new_type(tp_op *type_op, ir_mode *mode, ident* name);
- * INPUTS
- * type_op - the kind of this type. May not be type_id.
- * mode - the mode to be used for this type, may be NULL
- * name - an ident for the name of this type.
- * RESULT
- * a new type of the given type. The remaining private attributes are not
- * initalized. The type is in state layout_undefined.
- ***
*/
INLINE type *
new_type(tp_op *type_op,
/* Copyright (C) 2001 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
*/
/* $Id$ */
# include "type.h"
-/****h* libfirm/typegmod
+/**
*
- * NAME
* file typegmod.h
- * COPYRIGHT
* (C) 2001 by Universitaet Karlsruhe
- * AUTHORS
* Goetz Lindenmaier
- * NOTES
* This module supplies routines that support changing the type graph.
- *****
*/
-/****f* tpop/exchange_types
+/**
*
- * NAME
- * exchange_types -- replaces one type by the other.
- * SYNOPSIS
- * void exchange_types(type *old_type, type *new_type);
- * INPUTS
- * The old type that shall be replaced by the new type.
- * SIDE EFFECTS
+ * - replaces one type by the other.
+ * @param The old type that shall be replaced by the new type.
* Old type is replaced by new_type. All references to old_type
* now point to new_type. The memory for the old type is destroyed,
* but still used. Therefore it is not freed.
* An exception is the list of types in irp (irprog.h).
* In the future there might be a routine to recover the memory, but
* this will be at considerable runtime cost.
- ***
+ *
*/
INLINE void exchange_types(type *old_type, type *new_type);
-/****f* tpop/skip_tid
+/**
*
- * NAME
- * skip_tid -- skip id types until a useful type is reached.
- * SYNOPSIS
- * type *skip_tid(type *tp)
- * INPUTS
- * A type of arbitrary kind.
- * RETURNS
+ * - skip id types until a useful type is reached.
+ * @param A type of arbitrary kind.
* tp if it is not an id type.
* If tp is an id type retruns the real type it stands for.
- ***
+ *
*/
INLINE type *skip_tid(type *tp);
# include "typegmod.h"
-/****h* libfirm/typegmod
+/**
*
- * NAME
* file typegmod.h
- * COPYRIGHT
* (C) 2001 by Universitaet Karlsruhe
- * AUTHORS
* Goetz Lindenmaier
- * NOTES
* This module supplies routines that support changing the type graph.
- *****
*/
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Goetz Lindenmaier
-**
-** traverse the type information. The walker walks the whole ir graph
-** to find the distinct type trees in the type graph forest.
-** - execute the pre function before recursion
-** - execute the post function after recursion
+* All rights reserved.
+*
+* Author: Goetz Lindenmaier
+*
+* traverse the type information. The walker walks the whole ir graph
+* to find the distinct type trees in the type graph forest.
+* - execute the pre function before recursion
+* - execute the post function after recursion
*/
/* $Id$ */
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Goetz Lindenmaier
-**
-** traverse the type information. The walker walks the whole ir graph
-** to find the distinct type trees in the type graph forest.
-** - execute the pre function before recursion
-** - execute the post function after recursion
+* All rights reserved.
+*
+* Author: Goetz Lindenmaier
+*
+* traverse the type information. The walker walks the whole ir graph
+* to find the distinct type trees in the type graph forest.
+* - execute the pre function before recursion
+* - execute the post function after recursion
*/
/* $Id$ */
typedef void (type_walk_func)(type_or_ent *, void *);
-/** Walks over all type information reachable from global roots.
+/**
Touches every type and entity in unspecified order. If new
types/entities are created during the traversal these will
be visited, too. **/
type_walk_func *post,
void *env);
-/** Walks over all type information reachable from global roots.
+/**
Touches every class in specified order:
- first the super class
- second the class itself
type_walk_func *post,
void *env);
-/** Walks over all type information reachable from global roots.
+/**
Touches every class in specified order:
- first the super class
- second the class itself
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* testprogram.
*/
# include <string.h>
# include "irdump.h"
# include "firm.h"
-/** This example describes a possible representation of heap allocated
-*** variables of imperative programs.
-*** It constructs the IR for the following program:
-***
-***
-*** main(): int
-*** int *a[10];
-***
-*** a = malloc(sizeof(a[10]));
-*** return (a[3]);
-*** end;
-***
-*** The array is placed on the heap. The pointer to the array that
-*** is a local variable is represented as a dataflow edge.
-*** There are two ways to model allocation to the heap in programs with
-*** explicit memory allocation:
-*** 1. Model the calls to malloc and free as simple procedure (of compiler
-*** known procedures returning a pointer. This is the simpler way of
-*** generating FIRM, but restricts the information that can be deduced
-*** for the call.
-*** 2. Insert an Alloc node. A later pass can lower this to the compiler
-*** known function. This makes the allocation explicit in FIRM, supporting
-*** optimization.
-*** A problem is modeling free. There is no free node in FIRM. Is this
-*** a necessary extension?
-*** This example shows the second alternative, where the size of the array
-*** is explicitly computed.
+/**
+* variables of imperative programs.
+* It constructs the IR for the following program:
+*
+*
+* main(): int
+* int *a[10];
+*
+* a = malloc(sizeof(a[10]));
+* return (a[3]);
+* end;
+*
+* The array is placed on the heap. The pointer to the array that
+* is a local variable is represented as a dataflow edge.
+* There are two ways to model allocation to the heap in programs with
+* explicit memory allocation:
+* 1. Model the calls to malloc and free as simple procedure (of compiler
+* known procedures returning a pointer. This is the simpler way of
+* generating FIRM, but restricts the information that can be deduced
+* for the call.
+* 2. Insert an Alloc node. A later pass can lower this to the compiler
+* known function. This makes the allocation explicit in FIRM, supporting
+* optimization.
+* A problem is modeling free. There is no free node in FIRM. Is this
+* a necessary extension?
+* This example shows the second alternative, where the size of the array
+* is explicitly computed.
**/
#define OPTIMIZE_NODE 0
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* testprogram.
*/
# include <string.h>
# include "irdump.h"
# include "firm.h"
-/** This example describes representation of stack allocated variables of
-*** imperative programs.
-*** It constructs the IR for the following program:
-***
-***
-*** main(): int
-*** int a[10];
-***
-*** return (a[3]);
-*** end;
-***
-*** The array is placed on the stack, i.e., a pointer to the array
-*** is obtained by selecting the entity "a" from the stack. The variables
-*** on the stack are considered to be entities of the method, as locals
-*** of a method are only visible within the method. (An alternative to
-*** make the method owner of the stack variables is to give the ownership
-*** to the class representing the C-file. This would extend the visibility
-*** of the locals, though.)
+/**
+* imperative programs.
+* It constructs the IR for the following program:
+*
+*
+* main(): int
+* int a[10];
+*
+* return (a[3]);
+* end;
+*
+* The array is placed on the stack, i.e., a pointer to the array
+* is obtained by selecting the entity "a" from the stack. The variables
+* on the stack are considered to be entities of the method, as locals
+* of a method are only visible within the method. (An alternative to
+* make the method owner of the stack variables is to give the ownership
+* to the class representing the C-file. This would extend the visibility
+* of the locals, though.)
**/
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
# include <string.h>
# include "firm.h"
/**
-*** This file constructs the ir for the following pseudo-program:
-***
-*** void f(char *);
-***
-*** main() {
-*** f("Hello world !");
-*** }
+* This file constructs the ir for the following pseudo-program:
+*
+* void f(char *);
+*
+* main() {
+* f("Hello world !");
+* }
**/
int main(int argc, char **argv)
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
#include <stdio.h>
# include "firm.h"
/**
-*** This file constructs the ir for the following pseudo-program:
-***
-*** main(int a) {
-*** if ((a > 2) && (a < 10))
-*** { a = 1; }
-***
-*** return a;
+* This file constructs the ir for the following pseudo-program:
+*
+* main(int a) {
+* if ((a > 2) && (a < 10))
+* { a = 1; }
+*
+* return a;
**/
int main(int argc, char **argv)
/* Copyright (C) 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Author: Goetz Lindenmaier
+*
+* testprogram.
*/
#include <stdio.h>
# include "firm.h"
/**
-*** This file constructs type information for constant entities.
-***
-*** It constructs the information for a class type with a dispatch
-*** table. The class has a field a, and two methods f and g. The
-*** class is represented by a class type with two entities for the
-*** field a and the reference to the dispatch table. This reference
-*** is a constant entity. Ther dispatch table is also represented
-*** by a class type that contains the two methods. There is one entity
-*** of the dispatch table which is constant.
-***
-*** Further the example shows the representation of a constant global
-*** array.
-***
-*** class C {
-*** int a;
-*** void f();
-*** void g(int);
-*** }
-*** int[4] arre = (7, 2, 13, 92);
+* This file constructs type information for constant entities.
+*
+* It constructs the information for a class type with a dispatch
+* table. The class has a field a, and two methods f and g. The
+* class is represented by a class type with two entities for the
+* field a and the reference to the dispatch table. This reference
+* is a constant entity. Ther dispatch table is also represented
+* by a class type that contains the two methods. There is one entity
+* of the dispatch table which is constant.
+*
+* Further the example shows the representation of a constant global
+* array.
+*
+* class C {
+* int a;
+* void f();
+* void g(int);
+* }
+* int[4] arre = (7, 2, 13, 92);
**/
int main(int argc, char **argv)
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram
*/
#include <stdio.h>
# include "firm.h"
/**
-*** This file constructs the ir for the following pseudo-program:
-***
-*** main() {
-*** int c, d;
-***
-*** c = 5 + 7;
-*** d = 7 + 5;
-***
-*** return (c, d);
-*** }
+* This file constructs the ir for the following pseudo-program:
+*
+* main() {
+* int c, d;
+*
+* c = 5 + 7;
+* d = 7 + 5;
+*
+* return (c, d);
+* }
**/
int
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
# include <stdio.h>
*/
/**
-*** This file constructs a control flow of following shape:
-***
-***
-*** firstBlock
-*** / \
-*** / \
-*** |/_ _\|
-*** Block1 Block2 deadBlock
-*** \ | /
-*** \ | /
-*** _\| \ / |/_
-*** nextBlock
-***
-***
-*** This is a program as, e.g.,
-***
-*** if () then
-*** { Jmp label1; } // happens anyways
-*** else
-*** { Jmp label1; } // happens anyways
-*** label1:
-*** return();
-*** Jmp label1;
-***
+* This file constructs a control flow of following shape:
+*
+*
+* firstBlock
+* / \
+* / \
+* |/_ _\|
+* Block1 Block2 deadBlock
+* \ | /
+* \ | /
+* _\| \ / |/_
+* nextBlock
+*
+*
+* This is a program as, e.g.,
+*
+* if () then
+* { Jmp label1; } // happens anyways
+* else
+* { Jmp label1; } // happens anyways
+* label1:
+* return();
+* Jmp label1;
+*
**/
int main(int argc, char **argv)
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
*/
# include <stdio.h>
# include "firm.h"
/**
-*** An empty Firm program.
-***
-*** This file constructs the ir for the following pseudo-program:
-***
-*** main() {
-*** return;
-*** }
-***
-***
+* An empty Firm program.
+*
+* This file constructs the ir for the following pseudo-program:
+*
+* main() {
+* return;
+* }
+*
+*
**/
int main(int argc, char **argv)
/* (C) 2002 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* testprogram.
*/
/* $ID$ */
# include "firm.h"
/**
-*** This file constructs the ir for the following pseudo-program:
-***
-*** VAR_A is some extern variable.
-***
-*** main(int a) { // pos 0
-*** int b = 1; // pos 1
-*** int h; // pos 2
-***
-*** while (0 == 0) loop {
-*** h = a;
-*** a = b;
-*** b = h;
-*** VAR_A = b;
-*** }
-***
-*** return a-b;
-*** }
+* This file constructs the ir for the following pseudo-program:
+*
+* VAR_A is some extern variable.
+*
+* main(int a) { // pos 0
+* int b = 1; // pos 1
+* int h; // pos 2
+*
+* while (0 == 0) loop {
+* h = a;
+* a = b;
+* b = h;
+* VAR_A = b;
+* }
+*
+* return a-b;
+* }
**/
int
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
*/
# include <stdio.h>
# include "firm.h"
/**
-*** An Firm program to test float values.
-***
-*** This file constructs the ir for the following pseudo-program:
-***
-*** main() {
-*** ...
-*** }
-***
-***
+* An Firm program to test float values.
+*
+* This file constructs the ir for the following pseudo-program:
+*
+* main() {
+* ...
+* }
+*
+*
**/
int main(int argc, char **argv)
/* Copyright (C) 2002 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
/* $Id$ */
# include "firm.h"
/**
-*** This file constructs the ir for the following pseudo-program:
-***
-*** int main(int a) {
-*** int b = 2;
-*** if ( a == b ) {
-*** a := a - 3;
-*** } else {
-*** a := a - 3;
-*** a := a + 5;
-*** }
-*** return a;
-*** }
+* This file constructs the ir for the following pseudo-program:
+*
+* int main(int a) {
+* int b = 2;
+* if ( a == b ) {
+* a := a - 3;
+* } else {
+* a := a - 3;
+* a := a + 5;
+* }
+* return a;
+* }
**/
int
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** testprogram.
-**
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* testprogram.
+*
*/
# include <stdio.h>
*/
/**
-*** This program shows how to build ir for global variables.
-*** It constructs the ir for the following pseudo-program:
-***
-*** int i;
-***
-*** main() {
-*** i = 2;
-*** return;
-*** }
+* This program shows how to build ir for global variables.
+* It constructs the ir for the following pseudo-program:
+*
+* int i;
+*
+* main() {
+* i = 2;
+* return;
+* }
**/
int main(int argc, char **argv)
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
# include <stdio.h>
*/
/**
-*** This file constructs the ir for the following pseudo-program:
-***
-*** main() {
-*** int a = 0;
-*** int b = 1;
-***
-*** if (a > 2)
-*** { a = b; }
-*** else
-*** { b = 2; }
-***
-*** return a, b;
+* This file constructs the ir for the following pseudo-program:
+*
+* main() {
+* int a = 0;
+* int b = 1;
+*
+* if (a > 2)
+* { a = b; }
+* else
+* { b = 2; }
+*
+* return a, b;
**/
int main(int argc, char **argv)
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
# include <stdio.h>
# include "firm.h"
/**
-*** This file constructs the ir for the following pseudo-program:
-***
-*** int main(int a) {
-*** int b = 2;
-*** if ( a == b )
-*** { a := a - 3; }
-***
-*** return a;
-*** }
+* This file constructs the ir for the following pseudo-program:
+*
+* int main(int a) {
+* int b = 2;
+* if ( a == b )
+* { a := a - 3; }
+*
+* return a;
+* }
**/
int
/* (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
# include <stdio.h>
# include "firm.h"
/**
-*** This file constructs the ir for the following pseudo-program:
-***
-*** main() {
-*** int a = 0; // pos 0
-*** int b = 1; // pos 1
-*** int h; // pos 2
-***
-*** if (0 == 0)
-*** { a = 2; }
-***
-*** while (0 == 0) loop {
-*** h = a;
-*** a = b;
-*** b = h;
-*** }
-***
-*** return a-b;
-*** }
+* This file constructs the ir for the following pseudo-program:
+*
+* main() {
+* int a = 0; // pos 0
+* int b = 1; // pos 1
+* int h; // pos 2
+*
+* if (0 == 0)
+* { a = 2; }
+*
+* while (0 == 0) loop {
+* h = a;
+* a = b;
+* b = h;
+* }
+*
+* return a-b;
+* }
**/
int
/* Copyright (C) 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Author: Goetz Lindenmaier
+*
+* testprogram.
*/
# include <stdio.h>
# include "firm.h"
/**
-*** This file constructs type information for the following pseudo-program.
-*** The procedure code is not constructed.
-***
-*** interface I {
-*** void m1 (void);
-*** }
-***
-*** class C implements I {
-*** void m1 (void) {return};
-*** void m2 (int) {return 0};
-*** }
-***
-*** class D {
-*** int b;
-*** }
-***
-*** class E extends C, D {
-*** void m2 (int) {return 1};
-*** int a;
-*** }
-***
+* This file constructs type information for the following pseudo-program.
+* The procedure code is not constructed.
+*
+* interface I {
+* void m1 (void);
+* }
+*
+* class C implements I {
+* void m1 (void) {return};
+* void m2 (int) {return 0};
+* }
+*
+* class D {
+* int b;
+* }
+*
+* class E extends C, D {
+* void m2 (int) {return 1};
+* int a;
+* }
+*
**/
int main(int argc, char **argv)
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
# include <stdio.h>
*/
/**
-*** This file constructs a control flow of following shape:
-***
-*** StartBlock
-*** |
-*** \|/
-*** Block ---> Block
-*** | |
-*** \|/ \|/
-*** Block ---> Block
-*** | |
-*** \|/ \|/
-*** Block ---> Block
-*** |
-*** \|/
-*** EndBlock
-***
-*** This is a program as, e.g.,
-***
-*** switch (expr){
-*** case 1:
-*** case 2:
-*** break;
-*** default:
-*** }
-*** return
+* This file constructs a control flow of following shape:
+*
+* StartBlock
+* |
+* \|/
+* Block ---> Block
+* | |
+* \|/ \|/
+* Block ---> Block
+* | |
+* \|/ \|/
+* Block ---> Block
+* |
+* \|/
+* EndBlock
+*
+* This is a program as, e.g.,
+*
+* switch (expr){
+* case 1:
+* case 2:
+* break;
+* default:
+* }
+* return
**/
int main(int argc, char **argv)
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
# include <stdio.h>
*/
/**
-*** This file constructs a control flow of following shape:
-***
-***
-*** firstBlock
-*** / \
-*** / \
-*** |/_ _\|
-*** ---->
-*** LoopBlock1 LoopBlock2
-*** <----
-*** \ /
-*** \ /
-*** _\| |/_
-*** nextBlock
-***
-***
+* This file constructs a control flow of following shape:
+*
+*
+* firstBlock
+* / \
+* / \
+* |/_ _\|
+* ---->
+* LoopBlock1 LoopBlock2
+* <----
+* \ /
+* \ /
+* _\| |/_
+* nextBlock
+*
+*
**/
int main(int argc, char **argv)
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
# include "irdump.h"
# include "firm.h"
-/** This example demonstrates the use of memory edges.
-*** This file constructs the ir for the following pseudo-program:
-***
-*** int VAR_A
-*** int VAR_B
-***
-*** main() {
-***
-*** VAR_A = 0
-*** VAR_B = 1
-***
-*** repeat {
-*** h = VAR_A;
-*** VAR_A = VAR_B;
-*** VAR_B = h;
-*** } until (0 == h)
-***
-*** return (VAR_A)
-*** }
-***
-***
-*** A better example would be the following program:
-*** (name e.g.: memory-imp_example.c as it models imperative concepts.)
-***
-*** In this program a local variable is dereferenced. It has
-*** to be modeled as an entity of the stack so that a pointer to it is available.
-*** It is also an example where an analysis could find out that the
-*** pointer is never actually used.
-***
-*** main () {
-*** int a;
-*** int *p;
-***
-*** a = 2;
-*** p = &a;
-*** return (*p);
-*** }
-***
+/**
+* This file constructs the ir for the following pseudo-program:
+*
+* int VAR_A
+* int VAR_B
+*
+* main() {
+*
+* VAR_A = 0
+* VAR_B = 1
+*
+* repeat {
+* h = VAR_A;
+* VAR_A = VAR_B;
+* VAR_B = h;
+* } until (0 == h)
+*
+* return (VAR_A)
+* }
+*
+*
+* A better example would be the following program:
+* (name e.g.: memory-imp_example.c as it models imperative concepts.)
+*
+* In this program a local variable is dereferenced. It has
+* to be modeled as an entity of the stack so that a pointer to it is available.
+* It is also an example where an analysis could find out that the
+* pointer is never actually used.
+*
+* main () {
+* int a;
+* int *p;
+*
+* a = 2;
+* p = &a;
+* return (*p);
+* }
+*
**/
int
/* Copyright (C)2002 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* testprogram.
*/
/* $ID$ */
# include "irdump.h"
# include "firm.h"
-/** This file constructs the IR for the following program:
-*** @@@ this is no more correct ...
-*** class PRIMA {
-*** a: int;
-***
-*** int c(d: int) {
-*** return (d + self.a);
-*** }
-***
-*** void set_a(e:int) {
-*** self.a = e;
-*** }
-***
-*** }
-***
-*** int main() {
-*** o: PRIMA;
-*** o = new PRIMA;
-*** o.set_a(2);
-*** return o.c(5);
-*** };
-***
+/**
+* @@@ this is no more correct ...
+* class PRIMA {
+* a: int;
+*
+* int c(d: int) {
+* return (d + self.a);
+* }
+*
+* void set_a(e:int) {
+* self.a = e;
+* }
+*
+* }
+*
+* int main() {
+* o: PRIMA;
+* o = new PRIMA;
+* o.set_a(2);
+* return o.c(5);
+* };
+*
**/
int
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* testprogram.
*/
# include <stdio.h>
# include "irdump.h"
# include "firm.h"
-/** This file constructs the IR for the following program:
-***
-*** class PRIMA {
-*** a: int;
-***
-*** int c(d: int) {
-*** return (d + self.a);
-*** }
-***
-*** void set_a(e:int) {
-*** self.a = e;
-*** }
-***
-*** }
-***
-*** int main() {
-*** o: PRIMA;
-*** o = new PRIMA;
-*** o.set_a(2);
-*** return o.c(5);
-*** };
-***
+/**
+*
+* class PRIMA {
+* a: int;
+*
+* int c(d: int) {
+* return (d + self.a);
+* }
+*
+* void set_a(e:int) {
+* self.a = e;
+* }
+*
+* }
+*
+* int main() {
+* o: PRIMA;
+* o = new PRIMA;
+* o.set_a(2);
+* return o.c(5);
+* };
+*
**/
int
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Christian Schaefer, Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Christian Schaefer, Goetz Lindenmaier
+*
+* testprogram.
*/
# include <stdio.h>
*/
/**
-*** This file constructs a control flow of following shape:
-***
-***
-*** firstCondBlock
-*** / \
-*** / \
-*** |/_ _\|
-*** Block1 scnCondBlock
-*** | | |
-*** | | |
-*** | \ / \ /
-*** | Block2 Block3
-*** \ | /
-*** \ | /
-*** _\| \ / |/_
-*** nextBlock
-***
-***
-*** This is a program as, e.g.,
-***
-*** if () then
-*** { Jmp label1; } // happens anyways
-*** else
-*** { Jmp label1; } // happens anyways
-*** label1:
-*** return();
-*** Jmp label1;
-***
+* This file constructs a control flow of following shape:
+*
+*
+* firstCondBlock
+* / \
+* / \
+* |/_ _\|
+* Block1 scnCondBlock
+* | | |
+* | | |
+* | \ / \ /
+* | Block2 Block3
+* \ | /
+* \ | /
+* _\| \ / |/_
+* nextBlock
+*
+*
+* This is a program as, e.g.,
+*
+* if () then
+* { Jmp label1; } // happens anyways
+* else
+* { Jmp label1; } // happens anyways
+* label1:
+* return();
+* Jmp label1;
+*
**/
int main(int argc, char **argv)
/* Copyright (C) 2001 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Authors: Goetz Lindenmaier
-**
-** testprogram.
+* All rights reserved.
+*
+* Authors: Goetz Lindenmaier
+*
+* testprogram.
*/
# include <stdio.h>
# include "firm.h"
/**
-*** This file constructs the ir for the following pseudo-program:
-***
-*** main(int a) { // pos 0
-*** int b = 1; // pos 1
-*** int h; // pos 2
-***
-*** while (0 == 2) loop {
-*** h = a;
-*** a = b;
-*** b = h;
-*** }
-***
-*** return a-b;
-*** }
+* This file constructs the ir for the following pseudo-program:
+*
+* main(int a) { // pos 0
+* int b = 1; // pos 1
+* int h; // pos 2
+*
+* while (0 == 2) loop {
+* h = a;
+* a = b;
+* b = h;
+* }
+*
+* return a-b;
+* }
**/
int