PIPS
|
Go to the source code of this file.
Data Structures | |
struct | __string_buffer_head |
internally defined structure. More... | |
Macros | |
#define | BUFFER_SIZE 512 |
Functions | |
string_buffer | string_buffer_make (bool dup) |
allocate a new string buffer More... | |
void | string_buffer_reset (string_buffer sb) |
remove stack contents More... | |
void | string_buffer_free (string_buffer *psb) |
free string buffer structure, also free string contents according to the dup field More... | |
void | string_buffer_free_all (string_buffer *psb) |
free string buffer structure and force string freeing More... | |
size_t | string_buffer_size (const string_buffer sb) |
return the size of the string in string_buffer sb More... | |
bool | string_buffer_empty_p (const string_buffer sb) |
return whether string_buffer sb is empty. More... | |
static string | string_buffer_to_string_internal (const string_buffer sb, bool rev) |
convert to a malloced string, maybe in rev-ersed order of the appends More... | |
string | string_buffer_to_string (const string_buffer sb) |
return malloc'ed string from string buffer sb More... | |
string | string_buffer_to_string_reverse (const string_buffer sb) |
return malloc'ed string from string buffer sb going from bottom to top More... | |
void | string_buffer_to_file (const string_buffer sb, FILE *out) |
put string buffer into file. More... | |
void | string_buffer_append_c_string_buffer (string_buffer sb, const string_buffer src, int indent) |
put string buffer as a C-string definition of the string buffer, including external double-quotes. More... | |
static void | string_buffer_append_internal (string_buffer sb, const string s) |
append, without handling duplication More... | |
void | string_buffer_append (string_buffer sb, const string s) |
append string s (if non empty) to string buffer sb, the duplication is done if needed according to the dup field. More... | |
void | string_buffer_append_sb (string_buffer sb, const string_buffer sb2) |
append the string buffer sb2 to string buffer sb. More... | |
void | string_buffer_append_list (string_buffer sb, const list l) |
append a list of string to a string buffer. More... | |
void | string_buffer_cat (string_buffer sb, const string first,...) |
append a NULL terminated list of string to sb. More... | |
void | string_buffer_printf_alist (string_buffer sb, const string format, va_list *args) |
formatted alist version More... | |
void | string_buffer_printf (string_buffer sb, const string format,...) |
append a formatted string to sb More... | |
void | string_buffer_append_xml_text (string_buffer sb, const string stuff, bool also_nl) |
append a string with XML escapes More... | |
#define BUFFER_SIZE 512 |
Definition at line 160 of file string_buffer.c.
void string_buffer_append | ( | string_buffer | sb, |
const string | s | ||
) |
append string s (if non empty) to string buffer sb, the duplication is done if needed according to the dup field.
Definition at line 260 of file string_buffer.c.
References strdup(), and string_buffer_append_internal().
Referenced by add_margin(), append_xml_attribute(), close_extensions(), dump_common_layout(), dump_functional(), extensions_to_string(), get_symbol_table(), open_xml_logfile(), pips_stop_xml(), pragma_to_string(), print_call_precondition(), reductions_get_omp_pragma_str(), safe_get_line_interval(), set_to_string_buffer(), step_directive_to_strings(), string_buffer_append_c_string_buffer(), string_buffer_append_list(), string_buffer_append_numeric(), string_buffer_append_sb(), string_buffer_append_symbolic(), string_buffer_append_word(), string_buffer_cat(), string_buffer_printf_alist(), text_to_string_gen(), two_string_buffer_append_symbolic(), xml_Application(), xml_Argument(), xml_Array(), xml_AssignArgument(), xml_Bounds(), xml_Boxes(), xml_Call(), xml_Chain_Graph(), xml_code(), xml_Compute_and_Need(), xml_data(), xml_declarations(), xml_Full_Type(), xml_loop(), xml_Loop(), xml_Matrix(), xml_ParameterUseToArrayBound(), xml_Pattern_Paving(), xml_reference(), xml_references(), xml_Region_Parameter(), xml_Region_Range(), xml_Scalar(), xml_Task(), xml_task(), xml_TaskParameter(), xml_TaskParameters(), xml_TaskReturnParameter(), xml_tasks(), xml_tiling(), xml_Transposition(), and xml_Type_Entity().
void string_buffer_append_c_string_buffer | ( | string_buffer | sb, |
const string_buffer | src, | ||
int | indent | ||
) |
put string buffer as a C-string definition of the string buffer, including external double-quotes.
It adds escapes for special characters.
Definition at line 165 of file string_buffer.c.
References buffer, BUFFER_SIZE, message_assert, src, STACK_MAP_X, and string_buffer_append().
Referenced by opencl_compile_mergeable_dag().
|
static |
append, without handling duplication
Definition at line 251 of file string_buffer.c.
References stack_push().
Referenced by string_buffer_append(), and string_buffer_append_xml_text().
void string_buffer_append_list | ( | string_buffer | sb, |
const list | l | ||
) |
append a list of string to a string buffer.
Note that each element of the list is duplicated or not according to the dup field.
sb,the | string buffer where to append the whole list |
l,the | list of string to append to the string buffer |
Definition at line 282 of file string_buffer.c.
References FOREACH, and string_buffer_append().
Referenced by pragma_to_string().
void string_buffer_append_sb | ( | string_buffer | sb, |
const string_buffer | sb2 | ||
) |
append the string buffer sb2 to string buffer sb.
sb,the | string buffer where to append the second string buffer |
sb2,the | string buffer to append to the fisrt string buffer |
Definition at line 271 of file string_buffer.c.
References __string_buffer_head::ins, STACK_MAP_X, and string_buffer_append().
Referenced by freia_spoc_code_buildup(), freia_terapix_call(), and opencl_compile_mergeable_dag().
void string_buffer_append_xml_text | ( | string_buffer | sb, |
const string | stuff, | ||
bool | also_nl | ||
) |
append a string with XML escapes
Definition at line 342 of file string_buffer.c.
References malloc(), and string_buffer_append_internal().
Referenced by append_xml_attribute(), string_buffer_append_symbolic(), string_buffer_append_word(), two_string_buffer_append_symbolic(), xml_Argument(), xml_Array(), xml_AssignArgument(), xml_Call(), xml_Chain_Graph(), xml_Compute_and_Need(), xml_Loop(), xml_ParameterUseToArrayBound(), xml_Pattern_Paving(), xml_Region_Parameter(), xml_Scalar(), xml_TaskParameter(), xml_Transposition(), and xml_Type_Entity().
void string_buffer_cat | ( | string_buffer | sb, |
const string | first, | ||
... | |||
) |
append a NULL terminated list of string to sb.
sb | string buffer to be appended to |
first... | appended strings |
Definition at line 294 of file string_buffer.c.
References string_buffer_append().
Referenced by pips_log_xml(), set_to_string_buffer(), and step_directive_to_strings().
bool string_buffer_empty_p | ( | const string_buffer | sb | ) |
return whether string_buffer sb is empty.
Definition at line 112 of file string_buffer.c.
References string_buffer_size().
Referenced by sc_delimiter(), and xml_TaskParameters().
void string_buffer_free | ( | string_buffer * | psb | ) |
free string buffer structure, also free string contents according to the dup field
Definition at line 82 of file string_buffer.c.
References free(), stack_free(), and STACK_MAP_X.
Referenced by dagvtx_dot(), freia_spoc_pipeline(), freia_terapix_call(), freia_trpx_compile_one_dag(), generic_print_xml_application(), get_symbol_table(), gpips_user_error(), gpips_user_warning(), mppa_compile_dag(), mppa_helper_args_params(), open_xml_logfile(), opencl_compile_mergeable_dag(), pips_log_xml(), pips_stop_xml(), safe_get_line_interval(), sc_delimiter(), sc_inst(), set_fprint(), set_to_string(), string_buffer_free_all(), text_to_string_gen(), words_type(), wpips_user_error(), wpips_user_warning(), and xml_Chain_Graph().
void string_buffer_free_all | ( | string_buffer * | psb | ) |
free string buffer structure and force string freeing
Definition at line 94 of file string_buffer.c.
References message_assert, and string_buffer_free().
Referenced by close_extensions(), extensions_to_string(), pragma_to_string(), reductions_get_omp_pragma_str(), and step_directive_to_strings().
string_buffer string_buffer_make | ( | bool | dup | ) |
allocate a new string buffer
dup | tell whether to string duplicate appended strings if so, the strings will be freed later. |
Definition at line 58 of file string_buffer.c.
References __string_buffer_head::dup, __string_buffer_head::ins, malloc(), message_assert, and stack_make().
Referenced by close_extensions(), dagvtx_dot(), extensions_to_string(), freia_spoc_pipeline(), freia_terapix_call(), freia_trpx_compile_one_dag(), generic_print_xml_application(), get_symbol_table(), gpips_user_error(), gpips_user_warning(), mppa_compile_dag(), mppa_helper_args_params(), open_xml_logfile(), opencl_compile_mergeable_dag(), pips_log_xml(), pips_stop_xml(), pragma_to_string(), reductions_get_omp_pragma_str(), safe_get_line_interval(), sc_delimiter(), sc_inst(), set_to_string_buffer(), step_directive_to_strings(), text_to_string_gen(), words_type(), wpips_user_error(), wpips_user_warning(), xml_Boxes(), xml_Chain_Graph(), xml_code(), xml_Compute_and_Need(), xml_Pattern_Paving(), xml_Region_Range(), xml_TaskParameters(), and xml_tiling().
void string_buffer_printf | ( | string_buffer | sb, |
const string | format, | ||
... | |||
) |
append a formatted string to sb
sb | string buffer to be appended to |
format | printf format string |
... | values |
Definition at line 329 of file string_buffer.c.
References string_buffer_printf_alist().
Referenced by append_xml_line_numbers(), gpips_user_error(), gpips_user_warning(), pips_stop_xml(), wpips_user_error(), and wpips_user_warning().
void string_buffer_printf_alist | ( | string_buffer | sb, |
const string | format, | ||
va_list * | args | ||
) |
formatted alist version
Definition at line 309 of file string_buffer.c.
References free(), message_assert, string_buffer_append(), and vasprintf().
Referenced by gpips_user_error(), gpips_user_warning(), string_buffer_printf(), wpips_user_error(), and wpips_user_warning().
void string_buffer_reset | ( | string_buffer | sb | ) |
remove stack contents
Definition at line 70 of file string_buffer.c.
References free(), stack_empty_p(), and stack_pop().
Referenced by sc_delimiter(), and sc_inst().
size_t string_buffer_size | ( | const string_buffer | sb | ) |
return the size of the string in string_buffer sb
Definition at line 103 of file string_buffer.c.
References STACK_MAP_X.
Referenced by freia_terapix_call(), string_buffer_empty_p(), and string_buffer_to_string_internal().
void string_buffer_to_file | ( | const string_buffer | sb, |
FILE * | out | ||
) |
put string buffer into file.
Definition at line 155 of file string_buffer.c.
References out, and STACK_MAP_X.
Referenced by dagvtx_dot(), freia_trpx_compile_one_dag(), mppa_compile_dag(), open_xml_logfile(), opencl_compile_mergeable_dag(), pips_log_xml(), pips_stop_xml(), sc_delimiter(), and set_fprint().
string string_buffer_to_string | ( | const string_buffer | sb | ) |
return malloc'ed string from string buffer sb
Definition at line 141 of file string_buffer.c.
References string_buffer_to_string_internal().
Referenced by close_extensions(), extensions_to_string(), generic_print_xml_application(), get_symbol_table(), gpips_user_error(), gpips_user_warning(), mppa_helper_args_params(), pragma_to_string(), reductions_get_omp_pragma_str(), safe_get_line_interval(), sc_delimiter(), sc_inst(), set_to_string(), step_directive_to_strings(), text_to_string_gen(), words_type(), wpips_user_error(), wpips_user_warning(), xml_Boxes(), xml_Chain_Graph(), xml_code(), xml_Compute_and_Need(), xml_Pattern_Paving(), xml_Region_Range(), xml_TaskParameters(), and xml_tiling().
|
static |
convert to a malloced string, maybe in rev-ersed order of the appends
Definition at line 120 of file string_buffer.c.
References buf, current, malloc(), message_assert, STACK_MAP_X, and string_buffer_size().
Referenced by string_buffer_to_string(), and string_buffer_to_string_reverse().
string string_buffer_to_string_reverse | ( | const string_buffer | sb | ) |
return malloc'ed string from string buffer sb going from bottom to top
Definition at line 148 of file string_buffer.c.
References string_buffer_to_string_internal().
Referenced by sc_delimiter().