-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathcompiler.h
88 lines (70 loc) · 2.4 KB
/
compiler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
* compiler.h
*
* MathMap
*
* Copyright (C) 1997-2009 Mark Probst
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __COMPILER_H__
#define __COMPILER_H__
#include <complex.h>
#include <gsl/gsl_matrix.h>
#include "glib.h"
#include "tuples.h"
#include "exprtree.h"
#include "userval.h"
#include "drawable.h"
#include "tree_vectors.h"
#include "compiler_types.h"
#include "opmacros.h"
struct _mathmap_t;
struct _mathmap_invocation_t;
struct _mathmap_frame_t;
struct _mathmap_slice_t;
typedef union
{
RUNTIME_VALUE_DECL
} runtime_value_t;
/* TEMPLATE mathfuncs */
/* All the functions required to render an image efficiently */
typedef struct _mathfuncs_t
{
init_frame_func_t init_frame;
init_slice_func_t init_slice;
calc_lines_func_t calc_lines;
/* FIXME: only used for LLVM - remove eventually */
llvm_init_frame_func_t llvm_init_frame_func;
llvm_filter_func_t main_filter_func;
init_x_or_y_func_t init_x_func;
init_x_or_y_func_t init_y_func;
} mathfuncs_t;
/* END */
typedef mathfuncs_t (*initfunc_t) (struct _mathmap_invocation_t*);
#define DEFAULT_OPTIMIZATION_TIMEOUT 2
#define MAX_OP_ARGS 9
struct _filter_code_t;
void init_compiler (void);
void set_opmacros_filename (const char *filename);
int compiler_template_processor (struct _mathmap_t *mathmap, const char *directive, const char *arg, FILE *out, void *data);
initfunc_t gen_and_load_c_code (struct _mathmap_t *mathmap, void **module_info,
char *template_filename, char *include_path,
struct _filter_code_t **filter_codes);
void unload_c_code (void *module_info);
void gen_and_load_llvm_code (struct _mathmap_t *mathmap, char *template_filename,
struct _filter_code_t **filter_codes);
void unload_llvm_code (struct _mathmap_t *mathmap);
#endif