bearch: Disallow passing Projs to get_irn_ops().
[libfirm] / ir / be / bespillslots.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief       Spillslot coalescer.
9  * @author      Matthias Braun
10  * @date        27.07.2006
11  */
12 #ifndef FIRM_BE_BESPILLSLOTS_H
13 #define FIRM_BE_BESPILLSLOTS_H
14
15 #include <stdbool.h>
16
17 typedef struct be_fec_env_t be_fec_env_t;
18
19 /**
20  * Initializes a new frame entity coalescer environment
21  */
22 be_fec_env_t *be_new_frame_entity_coalescer(ir_graph *irg);
23
24 /**
25  * Frees a frame entity coalescer environment
26  */
27 void be_free_frame_entity_coalescer(be_fec_env_t *env);
28
29 /**
30  * Adds a node that needs a frame entity and consumes memory (Reload nodes). The
31  * memory edges are followed to find memory-phis and the entities that produce
32  * the memory values.
33  *
34  * @param env   The frame entity coalescer environment
35  * @param node  The node that uses the frame entity
36  * @param mode  The mode of the needed spillslot
37  * @param align The alignment of the needed spillslot
38  */
39 void be_node_needs_frame_entity(be_fec_env_t *env, ir_node *node,
40                                 const ir_mode *mode, int alignment);
41
42 typedef void (*set_frame_entity_func)(ir_node *node, ir_entity *entity);
43
44 /**
45  * Assigned frame entities to all the nodes added by be_node_needs_frame_entity.
46  * Adds memory perms where needed.
47  */
48 void be_assign_entities(be_fec_env_t *env, set_frame_entity_func set_frame,
49                         bool alloc_entities_at_begin);
50
51 #endif