libFirm
jit.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2015 Matthias Braun
4  */
5 
10 #ifndef FIRM_JIT_H
11 #define FIRM_JIT_H
12 
13 #include "firm_types.h"
14 
15 #include "begin.h"
16 
31 
36 
40 FIRM_API ir_jit_segment_t *be_new_jit_segment(void);
41 
46 FIRM_API void be_destroy_jit_segment(ir_jit_segment_t *segment);
47 
52 FIRM_API void be_jit_set_entity_addr(ir_entity *entity, void const *address);
53 
57 FIRM_API void const *be_jit_get_entity_addr(ir_entity const *entity);
58 
63  ir_graph *irg);
64 
68 FIRM_API unsigned be_get_function_size(ir_jit_function_t const *function);
69 
73 FIRM_API void be_emit_function(char *buffer, ir_jit_function_t *function);
74 
77 #include "end.h"
78 
79 #endif
void be_jit_set_entity_addr(ir_entity *entity, void const *address)
Set absolute address of global entities so relocations in jit compiled code an be resolved...
unsigned be_get_function_size(ir_jit_function_t const *function)
Return the buffer size necessary to emit function with be_emit_function().
struct ir_jit_segment_t ir_jit_segment_t
Just in time compilation environment.
Definition: jit.h:30
ir_jit_segment_t * be_new_jit_segment(void)
Create a new jit segment.
struct ir_jit_function_t ir_jit_function_t
Just in time compiled function with potentially unresolved relocations.
Definition: jit.h:35
void be_destroy_jit_segment(ir_jit_segment_t *segment)
Destroy jit segment segment.
void const * be_jit_get_entity_addr(ir_entity const *entity)
Return previously set address.
struct ir_entity ir_entity
Entity.
Definition: firm_types.h:83
ir_jit_function_t * be_jit_compile(ir_jit_segment_t *segment, ir_graph *irg)
Compile graph irg to a sequence of machine instructions and relocations.
void be_emit_function(char *buffer, ir_jit_function_t *function)
Emit function into buffer and resolve symbols and relocations.
struct ir_graph ir_graph
Procedure Graph.
Definition: firm_types.h:74