remove set_.*_member type functions, as you can too easily violate the owner <->...
[libfirm] / include / libfirm / irmemory.h
index 9a0ded3..5ac2f47 100644 (file)
@@ -28,6 +28,7 @@
 #define FIRM_ANA_IRMEMORY_H
 
 #include "firm_types.h"
+#include "begin.h"
 
 /** The alias relation of two memory addresses. */
 typedef enum {
@@ -80,23 +81,22 @@ typedef enum {
  * Called by get_alias_relation().
  */
 typedef ir_alias_relation (*DISAMBIGUATOR_FUNC)(
-       ir_graph *irg,
-       ir_node *adr1, ir_mode *mode1,
-       ir_node *adr2, ir_mode *mode2);
+       const ir_node *adr1, const ir_mode *mode1,
+       const ir_node *adr2, const ir_mode *mode2);
 
 /**
  * Classify a base pointer.
  *
- * @param irg  the graph of the pointer
  * @param irn  the node representing the base address
  * @param ent  the base entity of the base address iff any
  */
-ir_storage_class_class_t classify_pointer(ir_graph *irg, ir_node *irn, ir_entity *ent);
+FIRM_API ir_storage_class_class_t classify_pointer(const ir_node *irn,
+                                                   const ir_entity *ent);
 
 /**
  * Returns a human readable name for an alias relation.
  */
-const char *get_ir_alias_relation_name(ir_alias_relation rel);
+FIRM_API const char *get_ir_alias_relation_name(ir_alias_relation rel);
 
 /**
  * Determine the alias relation between two addresses.
@@ -132,22 +132,21 @@ const char *get_ir_alias_relation_name(ir_alias_relation rel);
  * If none of these rules apply, the points-to framework must be
  * interrogated to detect the alias relation.
  */
-ir_alias_relation get_alias_relation(
-       ir_graph *irg,
-       ir_node *adr1, ir_mode *mode1,
-       ir_node *adr2, ir_mode *mode2);
+FIRM_API ir_alias_relation get_alias_relation(
+       const ir_node *adr1, const ir_mode *mode1,
+       const ir_node *adr2, const ir_mode *mode2);
 
 /**
  * Set a source language specific memory disambiguator function.
  *
  * @param func  The callback.
  */
-void set_language_memory_disambiguator(DISAMBIGUATOR_FUNC func);
+FIRM_API void set_language_memory_disambiguator(DISAMBIGUATOR_FUNC func);
 
 /**
  * Initialize the relation cache.
  */
-void mem_disambig_init(void);
+FIRM_API void mem_disambig_init(void);
 
 /*
  * Determine the alias relation between two addresses and
@@ -161,25 +160,24 @@ void mem_disambig_init(void);
  *
  * @see get_alias_relation()
  */
-ir_alias_relation get_alias_relation_ex(
-       ir_graph *irg,
-       ir_node *adr1, ir_mode *mode1,
-       ir_node *adr2, ir_mode *mode2);
+FIRM_API ir_alias_relation get_alias_relation_ex(
+       const ir_node *adr1, const ir_mode *mode1,
+       const ir_node *adr2, const ir_mode *mode2);
 
 /**
  * Free the relation cache.
  */
-void mem_disambig_term(void);
+FIRM_API void mem_disambig_term(void);
 
-ir_entity_usage_computed_state get_irg_entity_usage_state(const ir_graph *irg);
+FIRM_API ir_entity_usage_computed_state get_irg_entity_usage_state(const ir_graph *irg);
 
-void set_irg_entity_usage_state(ir_graph *irg, ir_entity_usage_computed_state state);
+FIRM_API void set_irg_entity_usage_state(ir_graph *irg,
+                                         ir_entity_usage_computed_state state);
 
 /**
  * Assure that the entity usage flags have been computed for the given graph.
  *
- * This is an intraprocedural analysis that computes the entity usage state
- * for all local variables.
+ * This analysis computes the entity usage state for all local variables.
  *
  * Note that this is a conservative estimation that by no Firm transformation
  * can be invalidated, so it's only recomputed if manually triggered by calling
@@ -187,19 +185,19 @@ void set_irg_entity_usage_state(ir_graph *irg, ir_entity_usage_computed_state st
  * Even then the information is not cleaned from the variables, call
  * assure_irg_entity_usage_computed() again for recomputation.
  */
-void assure_irg_entity_usage_computed(ir_graph *irg);
+FIRM_API void assure_irg_entity_usage_computed(ir_graph *irg);
 
 /**
  * Returns the current address taken state of the globals.
  */
-ir_entity_usage_computed_state get_irp_globals_entity_usage_state(void);
+FIRM_API ir_entity_usage_computed_state get_irp_globals_entity_usage_state(void);
 
 /**
  * Sets the current address taken state of the globals.
  *
  * @param state  the new state
  */
-void set_irp_globals_entity_usage_state(ir_entity_usage_computed_state state);
+FIRM_API void set_irp_globals_entity_usage_state(ir_entity_usage_computed_state state);
 
 /**
  * Assure that the address taken flag is computed for the global and TLS entities (variables).
@@ -213,35 +211,47 @@ void set_irp_globals_entity_usage_state(ir_entity_usage_computed_state state);
  * Even then the information is not cleaned from the variables, call
  * assure_irp_globals_entity_usage_computed() again for recomputation.
  */
-void assure_irp_globals_entity_usage_computed(void);
+FIRM_API void assure_irp_globals_entity_usage_computed(void);
 
 /**
  * Get the memory disambiguator options for a graph.
  *
  * @param irg  the graph
  */
-unsigned get_irg_memory_disambiguator_options(ir_graph *irg);
+FIRM_API unsigned get_irg_memory_disambiguator_options(const ir_graph *irg);
 
 /**
  * Set the memory disambiguator options for a graph.
  *
  * @param irg      the graph
- * @param option   a set of options
+ * @param options  a set of options
  */
-void set_irg_memory_disambiguator_options(ir_graph *irg, unsigned options);
+FIRM_API void set_irg_memory_disambiguator_options(ir_graph *irg,
+                                                   unsigned options);
 
 /**
  * Set the global disambiguator options for all graphs not having local options.
  *
- * @param option   a set of options
+ * @param options  a set of options
  */
-void set_irp_memory_disambiguator_options(unsigned options);
+FIRM_API void set_irp_memory_disambiguator_options(unsigned options);
 
 /**
  * Mark all private methods, i.e. those of which all call sites are known.
  * We use a very convervative estimation yet: If the address of a method is
  * never taken AND its visibility is visibility_local, then it's private.
  */
-void mark_private_methods(void);
+FIRM_API void mark_private_methods(void);
 
-#endif /* FIRM_ANA_IRMEMORY_H */
+/**
+ * Creates an ir_prog pass for mark_private_methods().
+ *
+ * @param name     the name of this pass or NULL
+ *
+ * @return  the newly created ir_prog pass
+ */
+FIRM_API ir_prog_pass_t *mark_private_methods_pass(const char *name);
+
+#include "end.h"
+
+#endif