fixed typos
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Tue, 28 Dec 2004 12:30:23 +0000 (12:30 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Tue, 28 Dec 2004 12:30:23 +0000 (12:30 +0000)
used xmalloc
clean some indentation

[r4772]

ir/stat/dags.c
ir/stat/firmstat.c
ir/stat/firmstat.h
ir/stat/pattern.c
ir/stat/pattern.h
ir/stat/pattern_dmp.c
ir/stat/pattern_dmp.h
ir/stat/stat_dmp.c
ir/stat/stat_dmp.h

index 2e94efe..3fa80b2 100644 (file)
@@ -84,7 +84,7 @@ static dag_entry_t *get_irn_dag_entry(ir_node *n)
 #define set_irn_dag_entry(n, e) set_irn_link(n, e)
 
 /**
- * checks wheater a node is an arg
+ * checks wether a node is an arg
  */
 static int is_arg(ir_node *node)
 {
@@ -152,7 +152,7 @@ static void connect_dags(ir_node *node, void *env)
     set_irn_dag_entry(node, entry);
   }
 
-  /* if this option is set, Loads are onways leaves */
+  /* if this option is set, Loads are allways leaves */
   if (dag_env->options & FIRMSTAT_LOAD_IS_LEAVE && get_irn_op(node) == op_Load)
     return;
 
index ef7abaf..e098104 100644 (file)
@@ -31,6 +31,7 @@
 #include "pattern.h"
 #include "dags.h"
 #include "stat_dmp.h"
+#include "xmalloc.h"
 
 /*
  * need this to be static:
@@ -42,7 +43,7 @@
  */
 static ir_op _op_Phi0;
 
-/** The PhiM, just to count memorty Phi's. */
+/** The PhiM, just to count memory Phi's. */
 static ir_op _op_PhiM;
 
 /** The Mul by Const node. */
@@ -206,7 +207,7 @@ static void graph_clear_entry(graph_entry_t *elem, int all)
 }
 
 /**
- * Returns the acssociates graph_entry_t for an irg
+ * Returns the associated graph_entry_t for an irg
  */
 static graph_entry_t *graph_get_entry(ir_graph *irg, pset *set)
 {
@@ -247,7 +248,7 @@ static void opt_clear_entry(opt_entry_t *elem)
 }
 
 /**
- * Returns the associates opt_entry_t for an ir_op
+ * Returns the associated opt_entry_t for an ir_op
  */
 static opt_entry_t *opt_get_entry(const ir_op *op, pset *set)
 {
@@ -282,7 +283,7 @@ static void block_clear_entry(block_entry_t *elem)
 }
 
 /**
- * Returns the associates block_entry_t for an block
+ * Returns the associated block_entry_t for an block
  */
 static block_entry_t *block_get_entry(long block_nr, pset *set)
 {
@@ -413,7 +414,7 @@ static void update_call_stat(ir_node *call, graph_entry_t *graph)
   ir_graph *callee = NULL;
 
   /*
-   * If the block is bad, the whole subgraph will colabse later
+   * If the block is bad, the whole subgraph will collapse later
    * so do not count this call.
    * This happens in dead code.
    */
@@ -483,7 +484,7 @@ static void update_call_stat_2(ir_node *call, graph_entry_t *graph)
   ir_graph *callee = NULL;
 
   /*
-   * If the block is bad, the whole subgraph will colabse later
+   * If the block is bad, the whole subgraph will collapse later
    * so do not count this call.
    * This happens in dead code.
    */
@@ -536,7 +537,7 @@ static void update_node_stat(ir_node *node, void *env)
 }
 
 /**
- * walker for reachable nodes count for graphs on teh wait_q
+ * walker for reachable nodes count for graphs on the wait_q
  */
 static void update_node_stat_2(ir_node *node, void *env)
 {
@@ -754,7 +755,7 @@ static void update_graph_stat_2(graph_entry_t *global, graph_entry_t *graph)
  */
 static void stat_register_dumper(const dumper_t *dumper)
 {
-  dumper_t *p = malloc(sizeof(*p));
+  dumper_t *p = xmalloc(sizeof(*p));
 
   if (p) {
     *p = *dumper;
@@ -781,7 +782,7 @@ static void stat_dump_graph(graph_entry_t *entry)
 }
 
 /**
- * initialise the dumper
+ * initialize the dumper
  */
 static void stat_dump_init(const char *name)
 {
@@ -1302,7 +1303,7 @@ void stat_finish(const char *name)
       }
     }
 
-    /* some calculations are dependant, we pushed them on the wait_q */
+    /* some calculations are dependent, we pushed them on the wait_q */
     while (! pdeq_empty(status->wait_q)) {
       entry = pdeq_getr(status->wait_q);
 
index dd1ba44..da2a34d 100644 (file)
  * Statistic options, can be or'ed.
  */
 enum firmstat_options_t {
-  FIRMSTAT_ENABLED         = 0x00000001,       /**< enable statistics */
-  FIRMSTAT_PATTERN_ENABLED = 0x00000002,       /**< enable pattern calculation */
-  FIRMSTAT_COUNT_STRONG_OP = 0x00000004,       /**< if set, count Mul/Div/Mod/DivMod by constant */
-  FIRMSTAT_COUNT_DAG       = 0x00000008,        /**< if set, count DAG statistics */
-  FIRMSTAT_COUNT_DELETED   = 0x00000010,        /**< if set, count deleted graphs */
-  FIRMSTAT_CSV_OUTPUT      = 0x10000000         /**< CSV output of some mini-statistic */
+  FIRMSTAT_ENABLED         = 0x00000001,    /**< enable statistics */
+  FIRMSTAT_PATTERN_ENABLED = 0x00000002,    /**< enable pattern calculation */
+  FIRMSTAT_COUNT_STRONG_OP = 0x00000004,    /**< if set, count Mul/Div/Mod/DivMod by constant */
+  FIRMSTAT_COUNT_DAG       = 0x00000008,    /**< if set, count DAG statistics */
+  FIRMSTAT_COUNT_DELETED   = 0x00000010,    /**< if set, count deleted graphs */
+  FIRMSTAT_CSV_OUTPUT      = 0x10000000     /**< CSV output of some mini-statistic */
 };
 
 /**
@@ -41,24 +41,24 @@ void stat_finish(const char *name);
 #ifdef FIRM_STATISTICS
 
 typedef enum {
-  STAT_OPT_STG,                        /**< straightening optimization */
-  STAT_OPT_IFSIM,              /**< if simplification */
-  STAT_OPT_CONST_EVAL,          /**< constant evaluation */
-  STAT_OPT_ALGSIM,             /**< algebraic simplification */
-  STAT_OPT_PHI,                        /**< Phi optmization */
-  STAT_OPT_WAW,                        /**< Write-After-Write optimization */
-  STAT_OPT_WAR,                        /**< Write-After-Read optimization */
-  STAT_OPT_RAW,                        /**< Read-After-Write optimization */
-  STAT_OPT_RAR,                        /**< Read-After-Read optimization */
-  STAT_OPT_RC,                  /**< Read-a-Const optimization */
+  STAT_OPT_STG,         /**< straightening optimization */
+  STAT_OPT_IFSIM,       /**< if simplification */
+  STAT_OPT_CONST_EVAL,  /**< constant evaluation */
+  STAT_OPT_ALGSIM,      /**< algebraic simplification */
+  STAT_OPT_PHI,         /**< Phi optmization */
+  STAT_OPT_WAW,         /**< Write-After-Write optimization */
+  STAT_OPT_WAR,         /**< Write-After-Read optimization */
+  STAT_OPT_RAW,         /**< Read-After-Write optimization */
+  STAT_OPT_RAR,         /**< Read-After-Read optimization */
+  STAT_OPT_RC,          /**< Read-a-Const optimization */
   STAT_OPT_TUPLE,              /**< Tuple optimization */
-  STAT_OPT_ID,                 /**< ID optimization */
-  STAT_OPT_CSE,                 /**< common subexpression elimination */
-  STAT_OPT_STRENGTH_RED,       /**< strength reduction */
-  STAT_OPT_ARCH_DEP,           /**< architecture dependent optimization */
-  STAT_OPT_REASSOC,             /**< reassociation */
-  STAT_OPT_POLY_CALL,           /**< polymorphic call optimization */
-  STAT_LOWERED,                        /**< lowered */
+  STAT_OPT_ID,          /**< ID optimization */
+  STAT_OPT_CSE,         /**< common subexpression elimination */
+  STAT_OPT_STRENGTH_RED,/**< strength reduction */
+  STAT_OPT_ARCH_DEP,    /**< architecture dependent optimization */
+  STAT_OPT_REASSOC,     /**< reassociation */
+  STAT_OPT_POLY_CALL,   /**< polymorphic call optimization */
+  STAT_LOWERED,         /**< lowered */
 
   STAT_OPT_MAX
 } stat_opt_kind;
@@ -66,7 +66,7 @@ typedef enum {
 /**
  * initialize the statistics module.
  *
- * @param enable_options  Bitmask containing the statistic options
+ * @param enable_options  a bitmask containing the statistic options
  */
 void init_stat(unsigned enable_options);
 
index 683911f..8e7cf8a 100644 (file)
@@ -57,9 +57,9 @@ enum vlc_code_t {
  * An entry for patterns
  */
 typedef struct _pattern_entry_t {
-  counter_t   count;           /**< amount of pattern occurance */
-  unsigned    len;             /**< lenght of the VLC encoded buffer */
-  BYTE        buf[1];          /**< buffer contains the VLC encoded pattern */
+  counter_t   count;        /**< amount of pattern occurance */
+  unsigned    len;          /**< length of the VLC encoded buffer */
+  BYTE        buf[1];       /**< buffer contains the VLC encoded pattern */
 } pattern_entry_t;
 
 /**
@@ -76,11 +76,11 @@ enum options_t {
  * pattern info
  */
 typedef struct _pattern_info_t {
-  int                       enable;            /**< if non-zero, this module is enabled */
-  struct obstack            obst;              /**< obstack containing the counters */
-  HASH_MAP(pattern_entry_t) *pattern_hash;     /**< hash map containing the counter for pattern */
-  unsigned                  bound;             /**< lowest value for output */
-  unsigned                  options;           /**< option mask */
+  int                       enable;         /**< if non-zero, this module is enabled */
+  struct obstack            obst;           /**< obstack containing the counters */
+  HASH_MAP(pattern_entry_t) *pattern_hash;  /**< hash map containing the counter for pattern */
+  unsigned                  bound;          /**< lowest value for output */
+  unsigned                  options;        /**< option mask */
 } pattern_info_t;
 
 /*
@@ -89,7 +89,7 @@ typedef struct _pattern_info_t {
 static pattern_info_t _status, *status = &_status;
 
 /**
- * compare two elemnts for counter
+ * compare two elements for counter
  */
 static int pattern_count_cmp(const void *elt, const void *key)
 {
@@ -120,7 +120,7 @@ static int pattern_cmp(const void *elt, const void *key)
 }
 
 /**
- * initialise a code buffer
+ * initialize a code buffer
  */
 static void init_buf(CODE_BUFFER *buf, BYTE *data, unsigned len)
 {
@@ -144,7 +144,7 @@ static INLINE void put_byte(CODE_BUFFER *buf, BYTE byte)
 }
 
 /**
- * returns the current lenght of a buffer
+ * returns the current length of a buffer
  */
 static unsigned buf_lenght(const CODE_BUFFER *buf)
 {
@@ -152,7 +152,7 @@ static unsigned buf_lenght(const CODE_BUFFER *buf)
 }
 
 /**
- * returns the current lenght of a buffer
+ * returns the current length of a buffer
  */
 static const BYTE *buf_content(const CODE_BUFFER *buf)
 {
@@ -662,7 +662,7 @@ void stat_calc_pattern_history(ir_graph *irg)
 }
 
 /*
- * initialises the pattern history
+ * initializes the pattern history
  */
 void stat_init_pattern_history(int enable)
 {
index 6237606..7db8aff 100644 (file)
@@ -25,7 +25,7 @@
 void stat_calc_pattern_history(ir_graph *irg);
 
 /**
- * initialises the pattern history.
+ * initializes the pattern history.
  *
  * @param enable  Enable flag.
  */
index 76560a7..f9ee82f 100644 (file)
@@ -258,7 +258,7 @@ static void stdout_start_children(pattern_dumper_t *self, unsigned id)
 }
 
 /**
- * finishes childred  dumper
+ * finishes the children dumper
  */
 static void stdout_finish_children(pattern_dumper_t *self, unsigned id)
 {
@@ -342,7 +342,7 @@ void pattern_start_children(pattern_dumper_t *self, unsigned id)
 }
 
 /*
- * finishes childred dumper
+ * finishes the children dumper
  */
 void pattern_finish_children(pattern_dumper_t *self, unsigned id)
 {
index 03f4660..0077043 100644 (file)
@@ -41,12 +41,12 @@ void pattern_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, unsig
 void pattern_start_children(pattern_dumper_t *self, unsigned id);
 
 /**
- * finishes childred dumper
+ * finishes the children dumper
  */
 void pattern_finish_children(pattern_dumper_t *self, unsigned id);
 
 /**
- * finishes dumper, destroyes the dumper object
+ * finishes dumper, destroys the dumper object
  */
 void pattern_end(pattern_dumper_t *self);
 
index f9a539d..305dfcf 100644 (file)
@@ -87,7 +87,7 @@ static void simple_dump_opt_hash(dumper_t *dmp, pset *set, int index)
 }
 
 /**
- * dumps the endges count
+ * dumps the edges count
  */
 static void simple_dump_edges(dumper_t *dmp, counter_t *cnt)
 {
@@ -129,11 +129,11 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry)
         entry->cnt_walked.cnt[0], entry->cnt_walked_blocks.cnt[0],
         entry->cnt_was_inlined.cnt[0],
         entry->cnt_got_inlined.cnt[0],
-       entry->cnt_strength_red.cnt[0],
-       entry->is_leaf ? "YES" : "NO",
-       entry->is_leaf_call == LCS_NON_LEAF_CALL ? "NO" : (entry->is_leaf_call == LCS_LEAF_CALL ? "Yes" : "Maybe"),
-       entry->is_recursive ? "YES" : "NO",
-       entry->is_chain_call ? "YES" : "NO",
+           entry->cnt_strength_red.cnt[0],
+           entry->is_leaf ? "YES" : "NO",
+           entry->is_leaf_call == LCS_NON_LEAF_CALL ? "NO" : (entry->is_leaf_call == LCS_LEAF_CALL ? "Yes" : "Maybe"),
+           entry->is_recursive ? "YES" : "NO",
+           entry->is_chain_call ? "YES" : "NO",
         entry->cnt_all_calls.cnt[0],
         entry->cnt_indirect_calls.cnt[0]
     );
@@ -173,7 +173,7 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry)
 }
 
 /**
- * initialise the simple dumper
+ * initialize the simple dumper
  */
 static void simple_init(dumper_t *dmp, const char *name)
 {
@@ -279,7 +279,7 @@ static void csv_dump_graph(dumper_t *dmp, graph_entry_t *entry)
 }
 
 /**
- * initialise the simple dumper
+ * initialize the simple dumper
  */
 static void csv_init(dumper_t *dmp, const char *name)
 {
index 888302a..00b528f 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _STAT_DMP_H
+#define _STAT_DMP_H
+
 #include "firmstat_t.h"
 
 /**
@@ -11,3 +14,5 @@ extern const dumper_t simple_dumper;
  * @note Limited capabilities, mostly for the Firm paper
  */
 extern const dumper_t csv_dumper;
+
+#endif /* _STAT_DMP_H */