fixed the type of the entity number
[libfirm] / ir / lower / lower_intrinsics.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/lower/lower_intrinsics.h
4  * Purpose:     lowering of Calls of intrinsic functions
5  * Author:      Michael Beck
6  * Created:
7  * CVS-ID:      $Id$
8  * Copyright:   (c) 1998-2005 Universität Karlsruhe
9  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
10  */
11
12 /**
13  * @file lower_intrinsics.h
14  *
15  * Lowering of Calls of intrinsic functions.
16  *
17  * @author Michael Beck
18  */
19 #ifndef _LOWER_INTRINSICS_H_
20 #define _LOWER_INTRINSICS_H_
21
22 #include "firm_types.h"
23
24 /**
25  * An intrinsic mapper function.
26  *
27  * @param call   the Call node
28  * @param ctx    a context
29  *
30  * @return  non-zero if the call was mapped
31  */
32 typedef int (*i_mapper_func)(ir_node *call, void *ctx);
33
34 /**
35  * An intrinsic record.
36  */
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 */
41 } i_record;
42
43 /**
44  * Go through all graphs and map calls to intrinsic functions.
45  *
46  * Every call is reported to its mapper function, which is responsible for
47  * rebuilding the graph.
48  *
49  * current_ir_graph is always set.
50  *
51  * @param list    an array of intrinsic map records
52  * @param length  the length of the array
53  *
54  * @return number of found intrinsic calls
55  */
56 unsigned lower_intrinsic_calls(const i_record *list, int length);
57
58 /**
59  * A mapper for the integer absolute value: inttype abs(inttype v).
60  * Replaces the call by a Abs node.
61  *
62  * @return always 1
63  */
64 int i_mapper_Abs(ir_node *call, void *ctx);
65
66 /**
67  * A mapper for the alloca() function: pointer alloca(inttype size)
68  * Replaces the call by a Alloca(stack_alloc) node.
69  *
70  * @return always 1
71  */
72 int i_mapper_Alloca(ir_node *call, void *ctx);
73
74 #endif /* _LOWER_INTRINSICS_H_ */