- constify
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sun, 12 Oct 2008 00:28:29 +0000 (00:28 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sun, 12 Oct 2008 00:28:29 +0000 (00:28 +0000)
- add some doxygen comments

[r22777]

ir/be/bemodule.c
ir/be/bemodule.h
ir/be/bemodule_t.h
ir/be/bespilloptions.c
ir/be/bespilloptions.h

index 0143538..a00714a 100644 (file)
@@ -241,7 +241,7 @@ int dump_opt_module_vals(char *buf, size_t buflen, const char *name,
  * Add a new module to list.
  */
 void be_add_module_to_list(be_module_list_entry_t **list_head, const char *name,
-                           void *module)
+                           const void *module)
 {
        be_module_list_entry_t *entry = XMALLOC(be_module_list_entry_t);
        entry->name = name;
index 95e6911..c1cb23c 100644 (file)
@@ -57,7 +57,7 @@ void be_quit_modules(void);
 typedef struct be_module_list_entry_t be_module_list_entry_t;
 
 void be_add_module_to_list(be_module_list_entry_t **list_head, const char *name,
-                           void *module);
+                           const void *module);
 
 void be_add_module_list_opt(lc_opt_entry_t *grp, const char *name,
                             const char *description,
index 912c4a5..15b89a7 100644 (file)
 
 #include "bemodule.h"
 
+/**
+ * A module list entry.
+ */
 struct be_module_list_entry_t {
-       const char *name;
-       void *data;
-       struct be_module_list_entry_t *next;
+       const char *name;                    /**< The name of the entry. */
+       const void *data;                    /**< Some data associated with this entry. */
+       struct be_module_list_entry_t *next; /**< Points to the next entry. */
 };
 
 #endif /* FIRM_BE_BEMODULE_T_H */
index 0befa7c..9f436d3 100644 (file)
@@ -45,19 +45,19 @@ static const lc_opt_table_entry_t be_spill_options[] = {
 };
 
 static be_module_list_entry_t *spillers = NULL;
-static be_spiller_t *selected_spiller = NULL;
+static const be_spiller_t *selected_spiller = NULL;
 
-void be_register_spiller(const char *name, be_spiller_t *spiller)
+void be_register_spiller(const char *name, const be_spiller_t *spiller)
 {
-       if(selected_spiller == NULL)
+       if (selected_spiller == NULL)
                selected_spiller = spiller;
        be_add_module_to_list(&spillers, name, spiller);
 }
 
-void be_do_spill(be_irg_t *birg, const arch_register_class_tcls)
+void be_do_spill(be_irg_t *birg, const arch_register_class_t *cls)
 {
        assert(selected_spiller != NULL);
-       if(selected_spiller != NULL) {
+       if (selected_spiller != NULL) {
                selected_spiller->spill(birg, cls);
        }
 }
index 576a1b9..c5a77fd 100644 (file)
 extern int be_coalesce_spill_slots;
 extern int be_do_remats;
 
+/**
+ * An entry in the list of spill-algorithms.
+ */
 typedef struct be_spiller_t {
-       void (*spill) (be_irg_t *birg, const arch_register_class_t *cls);
+       /**
+        * The spill function.
+        *
+        * @param birg  the graph to spill on
+        * @param cls   the register class to spill
+        */
+       void (*spill)(be_irg_t *birg, const arch_register_class_t *cls);
 } be_spiller_t;
-void be_register_spiller(const char *name, be_spiller_t *spiller);
 
+/**
+ * Register a new spill algorithm.
+ *
+ * @param name     the name of the spill algorithm,
+ *                 used to select it
+ * @param spiller  a spill entry
+ */
+void be_register_spiller(const char *name, const be_spiller_t *spiller);
+
+/**
+ * Execute the selected spill algorithm
+ *
+ * @param birg  the graph to spill on
+ * @param cls   the register class to spill
+ */
 void be_do_spill(be_irg_t *birg, const arch_register_class_t *cls);
 
 #endif