becopyilp: Do not advertise the switch to dump the solution, because this is not...
[libfirm] / ir / be / bemodule.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief       Backend module interface.
9  * @author      Matthias Braun
10  * @date        11.12.2006
11  */
12 #ifndef FIRM_BE_BEMODULE_H
13 #define FIRM_BE_BEMODULE_H
14
15 /**
16  * Mark a function as module constructor.
17  * Currently you have to add modules manually in the list in bemodule.c.
18  * However future extensions might allow them to be automatically discovered
19  * when they are marked with BE_REGISTER_MODULE_CONSTRUCTOR
20  *
21  * Add this before your constructor as it will declare the function
22  */
23 #define BE_REGISTER_MODULE_CONSTRUCTOR(func)         void func(void);
24
25 /**
26  * Mark a function as module destructor.
27  *
28  * Add this before your constructor as it will declare the function
29  */
30 #define BE_REGISTER_MODULE_DESTRUCTOR(func)          void func(void);
31
32 /**
33  * Call all module constructors
34  */
35 void be_init_modules(void);
36
37 /**
38  * Call all module destructors
39  */
40 void be_quit_modules(void);
41
42 //---------------------------------------------------------------------------
43
44 #include "lc_opts.h"
45
46 typedef struct be_module_list_entry_t be_module_list_entry_t;
47
48 void be_add_module_to_list(be_module_list_entry_t **list_head, const char *name,
49                            void *module);
50
51 void be_add_module_list_opt(lc_opt_entry_t *grp, const char *name,
52                             const char *description,
53                             be_module_list_entry_t * const * first,
54                             void **var);
55
56 #endif /* FIRM_BE_BEMODULE_H */