3 * File name: ir/lower/lower_intrinsics.h
4 * Purpose: lowering of Calls of intrinsic functions
8 * Copyright: (c) 1998-2005 Universität Karlsruhe
9 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
13 * @file lower_intrinsics.h
15 * Lowering of Calls of intrinsic functions.
17 * @author Michael Beck
19 #ifndef _LOWER_INTRINSICS_H_
20 #define _LOWER_INTRINSICS_H_
22 #include "firm_types.h"
25 * An intrinsic mapper function.
27 * @param call the Call node
28 * @param ctx a context
30 * @return non-zero if the call was mapped
32 typedef int (*i_mapper_func)(ir_node *call, void *ctx);
35 * An intrinsic record.
37 typedef struct _i_record {
38 entity *i_ent; /**< the entity representing an intrinsic */
39 i_mapper_func i_mapper; /**< the mapper function to call */
40 void *ctx; /**< mapper context */
44 * Go through all graphs and map calls to intrinsic functions.
46 * Every call is reported to its mapper function, which is responsible for
47 * rebuilding the graph.
49 * current_ir_graph is always set.
51 * @param list an array of intrinsic map records
52 * @param length the length of the array
54 * @return number of found intrinsic calls
56 unsigned lower_intrinsic_calls(const i_record *list, int length);
59 * A mapper for the integer absolute value: inttype abs(inttype v)
63 int i_mapper_Abs(ir_node *call, void *ctx);
66 * A mapper for the alloca() function: pointer alloca(inttype size)
70 int i_mapper_Alloca(ir_node *call, void *ctx);
72 #endif /* _LOWER_INTRINSICS_H_ */