File: backend.c

package info (click to toggle)
cloog-ppl 0.16.1-7
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 8,128 kB
  • sloc: ansic: 24,358; sh: 10,324; makefile: 988; fortran: 194
file content (32 lines) | stat: -rw-r--r-- 525 bytes parent folder | download | duplicates (2)
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
#include <cloog/ppl/cloog.h>

static int cloog_ppl_count = 0;

/**
 * Allocate and initialize full state.
 */
CloogState *cloog_state_malloc(void)
{
	CloogState *state;

	if (cloog_ppl_count == 0) {
		if (ppl_initialize() < 0)
			return NULL;
	}
	cloog_ppl_count++;

	state = cloog_core_state_malloc();
	state->backend = NULL;
	return state;
}

/**
 * Free state and backend independent parts.
 */
void cloog_state_free(CloogState *state)
{
	cloog_core_state_free(state);

	if (--cloog_ppl_count == 0)
	    ppl_finalize();
}