Commit f5f4f8d1 authored by David Schleef's avatar David Schleef

add orc_program_get_max_accumulator_size()

parent 8c15aa2e
......@@ -607,3 +607,29 @@ orc_program_get_max_array_size (OrcProgram *program)
return max;
}
/**
* orc_program_get_max_accumulator_size:
* @program: a pointer to an OrcProgram structure
*
* Returns the size of the largest array used in the program.
*
* Returns: the number of bytes
*/
int
orc_program_get_max_accumulator_size (OrcProgram *program)
{
int i;
int max;
max = 0;
for(i=0;i<ORC_N_VARIABLES;i++){
if (program->vars[i].size) {
if (program->vars[i].vartype == ORC_VAR_TYPE_ACCUMULATOR) {
max = MAX(max, program->vars[i].size);
}
}
}
return max;
}
......@@ -538,6 +538,7 @@ void orc_target_register (OrcTarget *target);
OrcTarget *orc_target_get_by_name (const char *target_name);
int orc_program_get_max_var_size (OrcProgram *program);
int orc_program_get_max_array_size (OrcProgram *program);
int orc_program_get_max_accumulator_size (OrcProgram *program);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment