From 0e3517be8fa39acfd4ffca288426bda22c1bd28c Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 21 Dec 2006 14:58:05 +0000 Subject: [PATCH] old files --- ir/be/bemodules.c | 58 ----------------------------------------------- ir/be/bemodules.h | 40 -------------------------------- 2 files changed, 98 deletions(-) delete mode 100644 ir/be/bemodules.c delete mode 100644 ir/be/bemodules.h diff --git a/ir/be/bemodules.c b/ir/be/bemodules.c deleted file mode 100644 index 7ec3fd053..000000000 --- a/ir/be/bemodules.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Author: Matthias Braun - * Date: 29.09.2005 - * Copyright: (c) Universitaet Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include "bemodules.h" -#include "xmalloc.h" - -typedef struct _constructor_list_entry_t { - struct _constructor_list_entry_t *next; - be_module_constructor_func func; -} constructor_list_entry_t; - -static constructor_list_entry_t *constructors = NULL; - -static void free_constructor_list(void) -{ - constructor_list_entry_t *entry = constructors; - - while(entry != NULL) { - constructor_list_entry_t *next = entry->next; - free(entry); - entry = next; - } -} - -void be_module_add_constructor(be_module_constructor_func func) -{ - static int initialized = 0; - constructor_list_entry_t *entry; - - if(!initialized) { - atexit(free_constructor_list); - initialized = 1; - } - - entry = xmalloc(sizeof(entry[0])); - entry->next = constructors; - entry->func = func; - - constructors = entry; -} - -void be_module_call_constructors() -{ - constructor_list_entry_t *entry; - - for(entry = constructors; entry != NULL; entry = entry->next) { - entry->func(); - } -} diff --git a/ir/be/bemodules.h b/ir/be/bemodules.h deleted file mode 100644 index 2f687f26b..000000000 --- a/ir/be/bemodules.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Author: Matthias Braun - * Date: 11.12.2006 - * Copyright: (c) Universitaet Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. - */ -#ifndef BEMODULES_H_ -#define BEMODULES_H_ - -typedef void (*be_module_constructor_func)(void); - -/** - * Use this macro to register a module constructor. You should put this macro in - * a .c file of your module. Compiler magic will make sure that your constructor - * function gets called after the main backend structures are initialized. - * - * The module constructor is a convenient place to register commandline options, - * or add the module to extension lists. - */ -#define BE_REGISTER_MODULE_CONSTRUCTOR(func) \ - static void __attribute__((constructor)) _be_constructor(void) \ - { \ - be_module_add_constructor(func); \ - } - -// TODO msvc version - -/** - * Warning: internal function, use BE_REGISTER_MODULE_CONSTRUCTOR instead. - * - * This function registers the constructor function of a backend module - */ -void be_module_add_constructor(be_module_constructor_func func); - -/** - * Call all registered constructor functions - */ -void be_module_call_constructors(void); - -#endif -- 2.20.1