- offset = 0;
-
- /* We are looking for line number notes. Search backward
- before basic block to find correct ones. */
- insn = prev_nonnote_insn (insn);
- if (!insn)
- insn = get_insns ();
- else
- insn = NEXT_INSN (insn);
-
- while (insn != BB_END (bb))
- {
- if (NOTE_P (insn))
- {
- /* Must ignore the line number notes that
- immediately follow the end of an inline function
- to avoid counting it twice. There is a note
- before the call, and one after the call. */
- if (NOTE_LINE_NUMBER (insn)
- == NOTE_INSN_REPEATED_LINE_NUMBER)
- ignore_next_note = 1;
- else if (NOTE_LINE_NUMBER (insn) <= 0)
- /*NOP*/;
- else if (ignore_next_note)
- ignore_next_note = 0;
- else
- {
- expanded_location s;
- NOTE_EXPANDED_LOCATION (s, insn);
- output_location (s.file, s.line, &offset, bb);
- }
- }
- insn = NEXT_INSN (insn);
- }
-
- if (offset)
- {
- /* A file of NULL indicates the end of run. */
- gcov_write_unsigned (0);
- gcov_write_string (NULL);
- gcov_write_length (offset);
- }
+ if (bb == ENTRY_BLOCK_PTR->next_bb)
+ {
+ expanded_location curr_location =
+ expand_location (DECL_SOURCE_LOCATION (current_function_decl));
+ output_location (curr_location.file, curr_location.line,
+ &offset, bb);