diff options
Diffstat (limited to 'gcc/coverage.cc')
-rw-r--r-- | gcc/coverage.cc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/gcc/coverage.cc b/gcc/coverage.cc index a9825e5..ea71f46 100644 --- a/gcc/coverage.cc +++ b/gcc/coverage.cc @@ -379,7 +379,7 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, "use -Wno-error=coverage-mismatch to tolerate " "the mismatch but performance may drop if the " "function is hot\n"); - + if (!seen_error () && !warned++) { @@ -431,7 +431,7 @@ coverage_counter_alloc (unsigned counter, unsigned num) fn_b_ctrs[counter] = fn_n_ctrs[counter]; fn_n_ctrs[counter] += num; - + fn_ctr_mask |= 1 << counter; return 1; } @@ -446,7 +446,7 @@ tree_coverage_counter_ref (unsigned counter, unsigned no) gcc_assert (no < fn_n_ctrs[counter] - fn_b_ctrs[counter]); no += fn_b_ctrs[counter]; - + /* "no" here is an array index, scaled to bytes later. */ return build4 (ARRAY_REF, gcov_type_node, fn_v_ctrs[counter], build_int_cst (integer_type_node, no), NULL, NULL); @@ -729,7 +729,7 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum) DECL_SIZE_UNIT (var) = TYPE_SIZE_UNIT (array_type); varpool_node::finalize_decl (var); } - + fn_b_ctrs[i] = fn_n_ctrs[i] = 0; fn_v_ctrs[i] = NULL_TREE; } @@ -791,18 +791,18 @@ build_fn_info_type (tree type, unsigned counters, tree gcov_info_type) tree array_type; gcc_assert (counters); - + /* ctr_info::num */ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); fields = field; - + /* ctr_info::values */ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE, build_pointer_type (get_gcov_type ())); DECL_CHAIN (field) = fields; fields = field; - + finish_builtin_struct (ctr_info, "__gcov_ctr_info", fields, NULL_TREE); /* key */ @@ -810,13 +810,13 @@ build_fn_info_type (tree type, unsigned counters, tree gcov_info_type) build_pointer_type (build_qualified_type (gcov_info_type, TYPE_QUAL_CONST))); fields = field; - + /* ident */ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); DECL_CHAIN (field) = fields; fields = field; - + /* lineno_checksum */ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); @@ -857,7 +857,7 @@ build_fn_info (const struct coverage_data *data, tree type, tree key) CONSTRUCTOR_APPEND_ELT (v1, fields, build1 (ADDR_EXPR, TREE_TYPE (fields), key)); fields = DECL_CHAIN (fields); - + /* ident */ CONSTRUCTOR_APPEND_ELT (v1, fields, build_int_cstu (get_gcov_unsigned_t (), @@ -897,10 +897,10 @@ build_fn_info (const struct coverage_data *data, tree type, tree key) if (var) CONSTRUCTOR_APPEND_ELT (ctr, DECL_CHAIN (TYPE_FIELDS (ctr_type)), build_fold_addr_expr (var)); - + CONSTRUCTOR_APPEND_ELT (v2, NULL, build_constructor (ctr_type, ctr)); } - + CONSTRUCTOR_APPEND_ELT (v1, fields, build_constructor (TREE_TYPE (fields), v2)); @@ -960,13 +960,13 @@ build_info_type (tree type, tree fn_info_ptr_type) merge_fn_type); DECL_CHAIN (field) = fields; fields = field; - + /* n_functions */ field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); DECL_CHAIN (field) = fields; fields = field; - + /* function_info pointer pointer */ fn_info_ptr_type = build_pointer_type (build_qualified_type (fn_info_ptr_type, TYPE_QUAL_CONST)); @@ -1175,7 +1175,7 @@ coverage_obj_init (void) for (ix = 0; ix != GCOV_COUNTERS; ix++) if ((1u << ix) & prg_ctr_mask) n_counters++; - + /* Build the info and fn_info types. These are mutually recursive. */ gcov_info_type = lang_hooks.types.make_type (RECORD_TYPE); gcov_fn_info_type = lang_hooks.types.make_type (RECORD_TYPE); @@ -1184,7 +1184,7 @@ coverage_obj_init (void) gcov_fn_info_ptr_type = build_pointer_type (build_qualified_type (gcov_fn_info_type, TYPE_QUAL_CONST)); build_info_type (gcov_info_type, gcov_fn_info_ptr_type); - + /* Build the gcov info var, this is referred to in its own initializer. */ gcov_info_var = build_decl (BUILTINS_LOCATION, @@ -1213,10 +1213,10 @@ coverage_obj_fn (vec<constructor_elt, va_gc> *ctor, tree fn, { tree init = build_fn_info (data, gcov_fn_info_type, gcov_info_var); tree var = build_var (fn, gcov_fn_info_type, -1); - + DECL_INITIAL (var) = init; varpool_node::finalize_decl (var); - + CONSTRUCTOR_APPEND_ELT (ctor, NULL, build1 (ADDR_EXPR, gcov_fn_info_ptr_type, var)); return ctor; @@ -1242,7 +1242,7 @@ coverage_obj_finish (vec<constructor_elt, va_gc> *ctor, DECL_NAME (fn_info_ary) = get_identifier (name_buf); DECL_INITIAL (fn_info_ary) = build_constructor (fn_info_ary_type, ctor); varpool_node::finalize_decl (fn_info_ary); - + DECL_INITIAL (gcov_info_var) = build_info (TREE_TYPE (gcov_info_var), fn_info_ary, object_checksum); varpool_node::finalize_decl (gcov_info_var); @@ -1374,7 +1374,7 @@ coverage_finish (void) { vec<constructor_elt, va_gc> *fn_ctor = NULL; struct coverage_data *fn; - + for (fn = functions_head; fn; fn = fn->next) { fn_ctor = coverage_obj_fn (fn_ctor, fn->fn_decl, fn); |