Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,17 @@ ignore:
- "dev_tools/**"
- "tests/**"
- "util/**"
# Sources produced by dev_tools/bin/gen-ifc-map.
- '^src/ifc_map\.h$'
- '^src/ifc_map_functions\.c$'
- '^src/ifc_map_functions\.h$'
- '^src/ifc_map_functions_acc\.c$'
- '^src/ifc_map_functions_dbg\.c$'
- '^src/ifc_map_functions_mut\.c$'
- '^src/ifc_map_functions_val\.c$'
- '^src/ifc_modules_inst\.h$'
- '^src/ifc_modules_spec\.h$'
# Large generated data tables.
- '^src/unicode_name_fsm\.c$'
- '^src/builtin_defs\.h$'
- '^src/builtin_kinds\.h$'
28 changes: 28 additions & 0 deletions src/attribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -3762,6 +3762,7 @@ this is &scp.attributes.)
} /* get_attribute_link */

#if DEBUG
/* GCOVR_EXCL_START */

void db_attribute(an_attribute_ptr ap)
/*
Expand Down Expand Up @@ -3916,6 +3917,7 @@ including (a) the string descr, (b) a rendering of the given attribute, and
} /* if */
} /* db_log_attribute_action */

/* GCOVR_EXCL_STOP */
#else /* !DEBUG */

#define db_log_attribute_action(descr, ap, entity, entity_kind) /*Nothing*/
Expand Down Expand Up @@ -4195,11 +4197,13 @@ produces *p_type.
*p_type = new_type;
} /* if */
#if DEBUG
/* GCOVR_EXCL_START */
if (db_flag_is_set("trace_attributes")) {
for (ap = attributes; ap != NULL; ap = ap->next) {
db_log_attribute_action("attach", ap, (char*)new_type, iek_type);
} /* for */
} /* if */
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
} /* if */
} /* attach_type_attributes */
Expand Down Expand Up @@ -8070,10 +8074,12 @@ multiversioning isn't applicable.
} /* if */
} /* if */
#if DEBUG
/* GCOVR_EXCL_START */
if (db_flag_is_set("trace_attributes")) {
(void)fprintf(f_debug, "apply_target_attr: target=%s\n",
aap->variant.token);
} /* if */
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
return result;
} /* apply_target_attr */
Expand Down Expand Up @@ -8663,10 +8669,12 @@ STATIC_THREAD an_ELF_visibility_stack_entry_ptr
stack, and available for reuse. */

#if DEBUG
/* GCOVR_EXCL_START */
STATIC_THREAD unsigned long
num_ELF_visibility_stack_entries_allocated;
/* Number of ELF visibility stack entries allocated,
to track total use of memory. */
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */

void push_ELF_visibility(an_ELF_visibility_kind evk,
Expand All @@ -8685,7 +8693,9 @@ is TRUE if this "push" operation is for a namespace attribute.
} else {
entry = alloc_fe_of_type(an_ELF_visibility_stack_entry);
#if DEBUG
/* GCOVR_EXCL_START */
++num_ELF_visibility_stack_entries_allocated;
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
} /* if */
entry->next = ELF_visibility_stack;
Expand Down Expand Up @@ -10049,8 +10059,10 @@ STATIC_THREAD an_alias_fixup_ptr
avail_alias_fixups;

#if DEBUG
/* GCOVR_EXCL_START */
STATIC_THREAD unsigned long
num_alias_fixups_allocated;
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */


Expand All @@ -10072,7 +10084,9 @@ it will be pointed to by the aliased IL entry.
} else {
entry = (an_alias_fixup_ptr)alloc_fe(sizeof(an_alias_fixup));
#if DEBUG
/* GCOVR_EXCL_START */
++num_alias_fixups_allocated;
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
} /* if */
/* Append the entry at the of the fixup list. */
Expand Down Expand Up @@ -10514,8 +10528,10 @@ will be made later on.
#if REDEFINE_EXTNAME_PRAGMA_ENABLED

#if DEBUG
/* GCOVR_EXCL_START */
STATIC_THREAD unsigned long
pragma_extname_string_space;
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */

void redefine_extname_pragma(a_pending_pragma_ptr ppp)
Expand Down Expand Up @@ -10558,7 +10574,9 @@ process_alias_fixup_list.
/* Recreate the pragma string: "redefine_extname <src-name> <asm-name>". */
ppp->pragma_text = (char *)alloc_primary_file_scope_il(pragma_len);
#if DEBUG
/* GCOVR_EXCL_START */
pragma_extname_string_space += pragma_len;
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
/*lint -e(668)*/(void)memcpy(ppp->pragma_text, "redefine_extname ",
size_t_arg(prefix_len));
Expand Down Expand Up @@ -11043,7 +11061,9 @@ attributes.
pch_saved_var_array_elem(ELF_visibility_stack),
pch_saved_var_array_elem(avail_ELF_visibility_stack_entries),
#if DEBUG
/* GCOVR_EXCL_START */
pch_saved_var_array_elem(num_ELF_visibility_stack_entries_allocated),
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
#endif /* GNU_VISIBILITY_ATTRIBUTE_ALLOWED */
pch_saved_var_array_elem(asm_name_map),
Expand All @@ -11054,10 +11074,12 @@ attributes.
pch_saved_var_array_elem(last_alias_fixup),
pch_saved_var_array_elem(avail_alias_fixups),
#if DEBUG
/* GCOVR_EXCL_START */
pch_saved_var_array_elem(num_alias_fixups_allocated),
#if REDEFINE_EXTNAME_PRAGMA_ENABLED
pch_saved_var_array_elem(pragma_extname_string_space),
#endif /* REDEFINE_EXTNAME_PRAGMA_ENABLED */
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
#endif /* GNU_EXTENSIONS_ALLOWED || REDEFINE_EXTNAME_PRAGMA_ENABLED */
#if USE_X86_FUNCTION_MULTIVERSIONING && DO_IL_LOWERING
Expand Down Expand Up @@ -11107,7 +11129,9 @@ be initialized for each compilation.
ELF_visibility_stack = NULL;
avail_ELF_visibility_stack_entries = NULL;
#if DEBUG
/* GCOVR_EXCL_START */
num_ELF_visibility_stack_entries_allocated = 0;
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
#endif /* GNU_VISIBILITY_ATTRIBUTE_ALLOWED */
gnu_abi_tag_attribute_seen = FALSE;
Expand All @@ -11116,10 +11140,12 @@ be initialized for each compilation.
alias_fixup_list = NULL;
last_alias_fixup = NULL;
#if DEBUG
/* GCOVR_EXCL_START */
num_alias_fixups_allocated = 0;
#if REDEFINE_EXTNAME_PRAGMA_ENABLED
pragma_extname_string_space = 0;
#endif /* REDEFINE_EXTNAME_PRAGMA_ENABLED */
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
#endif /* GNU_EXTENSIONS_ALLOWED || REDEFINE_EXTNAME_PRAGMA_ENABLED */
memzero((char*)attr_family_seen, sizeof(attr_family_seen));
Expand All @@ -11129,6 +11155,7 @@ be initialized for each compilation.

#if GNU_EXTENSIONS_ALLOWED || REDEFINE_EXTNAME_PRAGMA_ENABLED
#if DEBUG
/* GCOVR_EXCL_START */

unsigned long show_attribute_space_used(void)
/*
Expand All @@ -11155,6 +11182,7 @@ entities.
return grand_total;
} /* show_attribute_space_used */

/* GCOVR_EXCL_STOP */
#endif /* DEBUG */

#endif /* GNU_EXTENSIONS_ALLOWED || REDEFINE_EXTNAME_PRAGMA_ENABLED */
Expand Down
2 changes: 2 additions & 0 deletions src/attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ attribute.h -- Declarations related to attribute.c (having to do with
BEGIN_EDG_NAMESPACE

#if DEBUG
/* GCOVR_EXCL_START */
extern void db_attribute(an_attribute_ptr ap);

extern void db_attribute_list(an_attribute_ptr ap);
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */

#if REDEFINE_EXTNAME_PRAGMA_ENABLED
Expand Down
4 changes: 4 additions & 0 deletions src/basics.h
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ BEGIN_EDG_NAMESPACE /* Conditionally open the "edg" namespace. */
#define DEBUG TRUE
#endif /* ifndef DEBUG */
#if DEBUG
/* GCOVR_EXCL_START */
EXTERN_THREAD int
debug_level;
/* Debug level. 0 means no debug output, 1 - 5
Expand All @@ -712,6 +713,7 @@ extern void debug_exit(void);
/* Macro that returns TRUE if the specified debug flag is set. */
#define db_flag_is_set(name) \
(db_active && debug_flag_is_set(name))
/* GCOVR_EXCL_STOP */
#else /* !DEBUG */

/* If debugging code is not included: */
Expand Down Expand Up @@ -763,7 +765,9 @@ extern void debug_exit(void);
determining whether two separately-compiled executables were built with
compatible configuration options. */
#if DEBUG
/* GCOVR_EXCL_START */
#define DUMP_CONFIG_ENABLED TRUE /* Do not change this. */
/* GCOVR_EXCL_STOP */
#else /* !DEBUG */
#define DUMP_CONFIG_ENABLED TRUE /* Okay to change this. */
#endif /* DEBUG */
Expand Down
18 changes: 18 additions & 0 deletions src/c_gen_be.c
Original file line number Diff line number Diff line change
Expand Up @@ -3276,6 +3276,7 @@ These two fields are normally consecutive members of the given "type", but
#if CHECKING
if (field->offset < rounded_after_field) {
#if DEBUG
/* GCOVR_EXCL_START */
if (prev_field != NULL) {
fprintf(f_debug, "curr field %s\n",
prev_field->source_corresp.name);
Expand All @@ -3285,6 +3286,7 @@ These two fields are normally consecutive members of the given "type", but
} /* if */
fprintf(f_debug, "next offset %lu\n", (unsigned long)field->offset);
fprintf(f_debug, "next alignment %lu\n", (unsigned long)alignment);
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
internal_error("field_padding: negative padding required");
} /* if */
Expand Down Expand Up @@ -5445,7 +5447,9 @@ type of the variable to which it refers.
} /* if */
if (!types_match) {
#if DEBUG
/* GCOVR_EXCL_START */
db_expression(expr);
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
internal_error("check_type_of_variable_node: enk_variable has wrong type");
} /* if */
Expand Down Expand Up @@ -6463,7 +6467,9 @@ there's some possibility of precedence confusion and need_parens is TRUE.
{ a_type_ptr op2_type = skip_typerefs(operand_2->type);
if (!il_identical_types(op2_type, expr_type)) {
#if DEBUG
/* GCOVR_EXCL_START */
db_expression(expr);
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
internal_error("dump_expr: bad type on eok_comma");
} /* if */
Expand Down Expand Up @@ -6574,7 +6580,9 @@ there's some possibility of precedence confusion and need_parens is TRUE.
if (!il_identical_types(op2_type, expr_type) ||
!il_identical_types(op3_type, expr_type)) {
#if DEBUG
/* GCOVR_EXCL_START */
db_expression(expr);
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
internal_error("dump_expr: bad type on eok_question");
} /* if */
Expand Down Expand Up @@ -6855,7 +6863,9 @@ done_with_unary_operation:;
#if CHECKING && !STANDALONE_UTILITY_PROGRAM
if (operand_2 != NULL) {
#if DEBUG
/* GCOVR_EXCL_START */
db_expression(expr);
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
internal_error("dump_expr: unary operator has wrong # of operands");
} /* if */
Expand All @@ -6865,7 +6875,9 @@ done_with_binary_operation:;
#if CHECKING && !STANDALONE_UTILITY_PROGRAM
if (operand_2->next != NULL) {
#if DEBUG
/* GCOVR_EXCL_START */
db_expression(expr);
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
internal_error("dump_expr: binary operator has wrong # of operands");
} /* if */
Expand Down Expand Up @@ -6905,7 +6917,9 @@ done_with_binary_operation:;
if (!il_identical_types(expr->type,
expr->variant.object_lifetime.expr->type)) {
#if DEBUG
/* GCOVR_EXCL_START */
db_expression(expr);
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
internal_error("dump_expr: bad type on enk_object_lifetime");
} /* if */
Expand Down Expand Up @@ -11817,7 +11831,9 @@ must be redone for each generated C file.
last_known_good_file = NULL;
in_comment = FALSE;
#if DEBUG
/* GCOVR_EXCL_START */
annotate = db_active;
/* GCOVR_EXCL_STOP */
#else /* !DEBUG */
annotate = FALSE;
#endif /* DEBUG */
Expand Down Expand Up @@ -12171,12 +12187,14 @@ from the primary source file name in the IL information.
/* Scan options. There's a limited set, so we don't use getopt. */
switch (argv[optind][1]) {
#if DEBUG
/* GCOVR_EXCL_START */
case 'd':
/* Scan debug argument */
if (proc_debug_option(argv[optind]+2)) {
command_line_error(ec_cl_error_in_debug_option_argument);
} /* if */
break;
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
#if !C_GEN_BE_GENERATES_ANSI_C
case 'i':
Expand Down
2 changes: 2 additions & 0 deletions src/cfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ MAKE_FRONT_END_CALLABLE is TRUE.
(including an internal error). */
f_error = default_error_output_file();
#if DEBUG
/* GCOVR_EXCL_START */
/* Initialize the file variable used for debug output. This should be
done before anything else that could potentially produce debug output. */
f_debug = f_error;
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
/* Do early (before command-line processing) initialization. */
fe_early_init();
Expand Down
4 changes: 4 additions & 0 deletions src/cfe_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ optional.
} /* read_into_string */

#if DEBUG
/* GCOVR_EXCL_START */

static thread_local a_daemon_string
trans_unit_tag;
Expand Down Expand Up @@ -146,6 +147,7 @@ about an unused function when CHECKING is FALSE.
return hash_ptr(a_string_view(str));
} /* hash_trans_unit_tag */

/* GCOVR_EXCL_STOP */
#endif /* DEBUG */

static thread_local int
Expand Down Expand Up @@ -231,6 +233,7 @@ invocation ticket.

/* Update the thread state. */
#if DEBUG
/* GCOVR_EXCL_START */
Opt<a_daemon_string> opt_tu_tag = read_into_string(&reader);

if (!opt_tu_tag.has_value()) {
Expand All @@ -245,6 +248,7 @@ invocation ticket.
hashing strategy for a_daemon_string. */
check_assertion(trans_unit_tag_hash ==
hash_trans_unit_tag(trans_unit_tag.as_temp_characters()));
/* GCOVR_EXCL_STOP */
#endif /* DEBUG */
fd_thread_output = ticket->communication_fd;

Expand Down
Loading
Loading