Skip to content

Commit b964b49

Browse files
committed
xxx
1 parent 02bc30d commit b964b49

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

cobc/codegen.c

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13728,26 +13728,28 @@ output_header (const char *locbuff, const struct cb_program *cp)
1372813728
static void
1372913729
output_cob_prof_data ()
1373013730
{
13731-
struct cb_text_list *l = procedures_list;
13731+
if (cb_flag_prof) {
13732+
struct cb_text_list *l = procedures_list;
1373213733

13733-
output_local ("/* cob_prof data */\n\n");
13734+
output_local ("/* cob_prof data */\n\n");
1373413735

13735-
output_local ("#include <libcob/cobprof.h>\n\n");
13736+
output_local ("#include <libcob/cobprof.h>\n\n");
1373613737

13737-
output_local ("static const char *procedures_names[%d] = {\n", procedures_list_len + 1);
13738-
while (l) {
13739-
output_local (" \"%s\",\n", l->text);
13740-
l = l->next;
13741-
}
13742-
output_local (" \"\"");
13743-
output_local ("};\n");
13738+
output_local ("static const char *procedures_names[%d] = {\n", procedures_list_len + 1);
13739+
while (l) {
13740+
output_local (" \"%s\",\n", l->text);
13741+
l = l->next;
13742+
}
13743+
output_local (" \"\"");
13744+
output_local ("};\n");
1374413745

13745-
output_local ("static struct cobprof_info *prof_info;\n");
13746+
output_local ("static struct cobprof_info *prof_info;\n");
1374613747

13747-
output_local ("\n/* End of cob_prof data */\n");
13748+
output_local ("\n/* End of cob_prof data */\n");
1374813749

13749-
procedures_list = NULL;
13750-
procedures_list_len = 0;
13750+
procedures_list = NULL;
13751+
procedures_list_len = 0;
13752+
}
1375113753
}
1375213754

1375313755
void
@@ -14025,8 +14027,7 @@ codegen_internal (struct cb_program *prog, const int subsequent_call)
1402514027

1402614028
output_local_base_cache ();
1402714029
output_local_field_cache (prog);
14028-
14029-
if (cb_flag_prof) output_cob_prof_data ();
14030+
output_cob_prof_data ();
1403014031

1403114032
/* Report data fields */
1403214033
if (prog->report_storage) {

libcob/common.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,10 @@ static struct config_tbl gc_conf[] = {
495495
{"COB_CORE_ON_ERROR", "core_on_error", "0", coeopts, GRP_MISC, ENV_UINT | ENV_ENUMVAL, SETPOS (cob_core_on_error)},
496496
{"COB_CORE_FILENAME", "core_filename", "./core.libcob", NULL, GRP_MISC, ENV_STR, SETPOS (cob_core_filename)},
497497
{"COB_DUMP_FILE", "dump_file", NULL, NULL, GRP_MISC, ENV_FILE, SETPOS (cob_dump_filename)},
498-
/*
499498
{"COB_PROF_FILE", "prof_file", NULL, NULL, GRP_MISC, ENV_FILE, SETPOS (cob_prof_filename)},
500499
{"COB_PROF_DISABLE", "prof_disable", "0", NULL, GRP_MISC, ENV_BOOL, SETPOS (cob_prof_disable)},
501500
{"COB_PROF_MAX_DEPTH", "prof_max_depth", "255", NULL, GRP_MISC, ENV_UINT, SETPOS (cob_prof_max_depth)},
502501
{"COB_IS_RUNNING_IN_TESTMODE", "testsuite_mode", "0", NULL, GRP_MISC, ENV_BOOL, SETPOS (cob_testsuite_mode)},
503-
*/
504502
{"COB_DUMP_WIDTH", "dump_width", "100", NULL, GRP_MISC, ENV_UINT, SETPOS (cob_dump_width)},
505503
#ifdef _WIN32
506504
/* checked before configuration load if set from environment in cob_common_init() */
@@ -3021,7 +3019,7 @@ call_exit_handlers_and_terminate (void)
30213019
h = h->next;
30223020
}
30233021
}
3024-
// Fabrice cob_prof_end();
3022+
cob_prof_end();
30253023
cob_terminate_routines ();
30263024
}
30273025

@@ -10168,7 +10166,7 @@ cob_init (const int argc, char **argv)
1016810166
cob_init_numeric (cobglobptr);
1016910167
cob_init_strings (cobglobptr);
1017010168
cob_init_move (cobglobptr, cobsetptr);
10171-
// Fabrice cob_init_prof (cobglobptr, cobsetptr);
10169+
cob_init_prof (cobglobptr, cobsetptr);
1017210170
cob_init_intrinsic (cobglobptr);
1017310171
cob_init_fileio (cobglobptr, cobsetptr);
1017410172
cob_init_call (cobglobptr, cobsetptr, check_mainhandle);

0 commit comments

Comments
 (0)