+/*
+ * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
/*
* Project: libFIRM
* File name: ir/tr/entity.h
* Created:
* CVS-ID: $Id$
* Copyright: (c) 1998-2006 Universität Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
/**
- * @file entity.h
- *
- * Entities represent all program known objects.
- *
- * @author Martin Trapp, Christian Schaefer
- * @author Goetz Lindenmaier
+ * @file entity.h
+ * @brief Representation of all program known entities.
+ * @author Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Michael Beck
+ * @version $Id$
+ * @summary
*
* An entity is the representation of program known objects in Firm.
* The primary concept of entities is to represent members of complex
*
* @link ir_entity
*/
-#ifndef _FIRM_TR_ENTITY_H_
-#define _FIRM_TR_ENTITY_H_
+#ifndef FIRM_TR_ENTITY_H
+#define FIRM_TR_ENTITY_H
#include "firm_types.h"
#include "dbginfo.h"
void set_entity_peculiarity(ir_entity *ent, ir_peculiarity pec);
/** Checks if an entity cannot be overridden anymore. */
-int get_entity_final(const ir_entity *ent);
+int is_entity_final(const ir_entity *ent);
/** Sets/resets the final flag of an entity. */
-void set_entity_final(ir_entity *ent, int final);
+void set_entity_final(ir_entity *ent, int final);
/** Checks if an entity is compiler generated. */
int is_entity_compiler_generated(const ir_entity *ent);
/** Sets/resets the compiler generated flag. */
void set_entity_compiler_generated(ir_entity *ent, int flag);
+/**
+ * The state of the address_taken flag.
+ */
+typedef enum {
+ ir_address_not_taken = 0, /**< The address is NOT taken. */
+ ir_address_taken_unknown = 1, /**< The state of the address taken flag is unknown. */
+ ir_address_taken = 2 /**< The address IS taken. */
+} ir_address_taken_state;
+
+/** Return the state of the address taken flag of an entity. */
+ir_address_taken_state get_entity_address_taken(const ir_entity *ent);
+
+/** Sets/resets the state of the address taken flag of an entity. */
+void set_entity_address_taken(ir_entity *ent, ir_address_taken_state flag);
+
+/** Return the name of the address_taken state. */
+const char *get_address_taken_state_name(ir_address_taken_state state);
+
/* -- Representation of constant values of entities -- */
-/** Returns true if the the node is representable as code on
- * const_code_irg. */
+/**
+ * Returns true if the the node is representable as code on
+ * const_code_irg.
+ *
+ * @deprecated This function is not used by libFirm and stays here
+ * only as a helper for the old Jack frontend.
+ */
int is_irn_const_expression(ir_node *n);
-/* Set current_ir_graph to get_const_code_irg() to generate a constant
- expression. */
/**
- * Copies a firm subgraph that complies to the restrictions for
+ * Copies a Firm subgraph that complies to the restrictions for
* constant expressions to current_block in current_ir_graph.
+ *
+ * @param dbg debug info for all newly created nodes
+ * @param n the node
+ *
+ * Set current_ir_graph to get_const_code_irg() to generate a constant
+ * expression.
*/
ir_node *copy_const_value(dbg_info *dbg, ir_node *n);
ir_node *get_compound_ent_value(ir_entity *ent, int pos);
/** Returns the access path for value at position pos. */
compound_graph_path *get_compound_ent_value_path(ir_entity *ent, int pos);
-/** Returns the position of a value with the given path.
- * The path must contain array indices for all array element entities. */
-int get_compound_ent_pos_by_path(ir_entity *ent, compound_graph_path *path);
/** Returns a constant value given the access path.
* The path must contain array indices for all array element entities. */
ir_node *get_compound_ent_value_by_path(ir_entity *ent, compound_graph_path *path);
*/
int get_compound_ent_value_offset_bytes(ir_entity *ent, int pos);
-/** Compute the array indices in compound graph paths of initialized entities.
- *
- * All arrays must have fixed lower and upper bounds. One array can
- * have an open upper bound. If there are several open bounds, we do
- * nothing. There must be initializer elements for all array
- * elements. Uses the link field in the array element entities. The
- * array bounds must be representable as integers.
- *
- * @param ent Any entity.
- * @return 0 in case of an error, 1 otherwise
- */
-int compute_compound_ent_array_indices(ir_entity *ent);
-
/* --- Fields of entities with a class type as owner --- */
/* Overwrites is a field that specifies that an access to the overwritten
entity in the supertype must use this entity. It's a list as with
int is_entity (const void *thing);
/** Returns true if the type of the entity is a primitive, pointer
- enumeration or method type. */
+ * enumeration or method type.
+ *
+ * @Note This is a different classification than from is_primitive_type().
+ */
int is_atomic_entity(ir_entity *ent);
/** Returns true if the type of the entity is a class, structure,
array or union type. */
* debugging, (configure with --enable-debug) else returns the address
* of the type cast to long.
*/
-long get_entity_nr(ir_entity *ent);
+long get_entity_nr(const ir_entity *ent);
/** Returns the entities visited count. */
unsigned long get_entity_visited(ir_entity *ent);
/** Sets the section of a method. */
void set_method_img_section(ir_entity *method, ir_img_section section);
-#endif /* _FIRM_TR_ENTITY_H_ */
+#endif /* FIRM_TR_ENTITY_H */