From ac6c481d5734d0aea887d1d598da10dc2c9910cd Mon Sep 17 00:00:00 2001 From: amylaar Date: Tue, 17 Feb 1998 10:26:44 +0000 Subject: * rtl.h (force_line_numbers, restore_line_number_status): Declare. * emit-rtl.c (force_line_numbers, restore_line_number_status): New functions. * stmt.c (struct nesting): Replace seenlabel with line_number_status. (expand_start_case): Adjust to this change. (check_seenlabel): New function. (pushcase, pushcase_range, expand_endcase): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18031 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/emit-rtl.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gcc/emit-rtl.c') diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 739ca53fde1..3da217ced04 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3457,3 +3457,25 @@ init_emit_once (line_numbers) pic_offset_table_rtx = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM); #endif } + +/* Query and clear/ restore no_line_numbers. This is used by the + switch / case handling in stmt.c to give proper line numbers in + warnings about unreachable code. */ + +int +force_line_numbers () +{ + int old = no_line_numbers; + + no_line_numbers = 0; + if (old) + force_next_line_note (); + return old; +} + +void +restore_line_number_status (old_value) + int old_value; +{ + no_line_numbers = old_value; +} -- cgit v1.2.1