becopyheur2: Cache the admissible registers eagerly.
[libfirm] / ir / ir / ircomplib.c
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief   Compilerlib entity creation related functions.
9  * @date    2011-09-22
10  * @author  Manuel Mohr
11  */
12 #include "config.h"
13
14 #include "irprog.h"
15 #include "iroptimize.h"
16 #include "typerep.h"
17
18 #include <stddef.h>
19 #include <assert.h>
20
21 /* The default implementation does not set a different ld name. */
22 static ir_entity *compilerlib_entity_def_creator(ident *id, ir_type *mt)
23 {
24         return new_entity(get_glob_type(), id, mt);
25 }
26
27 static compilerlib_entity_creator_t creator = compilerlib_entity_def_creator;
28
29 void set_compilerlib_entity_creator(compilerlib_entity_creator_t c)
30 {
31         assert(c != NULL);
32
33         creator = c;
34 }
35
36 compilerlib_entity_creator_t get_compilerlib_entity_creator()
37 {
38         return creator;
39 }
40
41 ir_entity *create_compilerlib_entity(ident *id, ir_type *mt)
42 {
43         return creator(id, mt);
44 }