mirror of
https://review.haiku-os.org/buildtools
synced 2025-01-19 12:51:22 +01:00
5873a060ca
* these are dependencies for gcc 4 Graphite engine build. * CLooG 0.18.0 includes ISL 0.11.1 which is the backend that the build script enables. * PPL is needed by GCC build even if it isn't the chosen backend.
53 lines
1.0 KiB
C
53 lines
1.0 KiB
C
#include <stdlib.h>
|
|
#include "../include/cloog/cloog.h"
|
|
|
|
/**
|
|
* Allocate state and initialize backend independent part.
|
|
*/
|
|
CloogState *cloog_core_state_malloc(void)
|
|
{
|
|
CloogState *state;
|
|
|
|
state = (CloogState *)malloc(sizeof(CloogState));
|
|
if (!state)
|
|
cloog_die("memory overflow.\n");
|
|
|
|
state->backend = NULL;
|
|
|
|
cloog_int_init(state->zero);
|
|
cloog_int_set_si(state->zero, 0);
|
|
cloog_int_init(state->one);
|
|
cloog_int_set_si(state->one, 1);
|
|
cloog_int_init(state->negone);
|
|
cloog_int_set_si(state->negone, -1);
|
|
|
|
state->block_allocated = 0;
|
|
state->block_freed = 0;
|
|
state->block_max = 0;
|
|
|
|
state->domain_allocated = 0;
|
|
state->domain_freed = 0;
|
|
state->domain_max = 0;
|
|
|
|
state->loop_allocated = 0;
|
|
state->loop_freed = 0;
|
|
state->loop_max = 0;
|
|
|
|
state->statement_allocated = 0;
|
|
state->statement_freed = 0;
|
|
state->statement_max = 0;
|
|
|
|
return state;
|
|
}
|
|
|
|
/**
|
|
* Free state.
|
|
*/
|
|
void cloog_core_state_free(CloogState *state)
|
|
{
|
|
cloog_int_clear(state->zero);
|
|
cloog_int_clear(state->one);
|
|
cloog_int_clear(state->negone);
|
|
free(state);
|
|
}
|