X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Finput-scrub.c;h=79e8de91966a103476b48faeb258dc50ddc79fd7;hb=3233d7d074e59b83f68a22071cff597f00d5ae81;hp=f5f2af214a2424194ea4e581f20d0ea4da5896e1;hpb=9cee1c1eb3d7a39279f7a0dae94bb38ab1106d1b;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/input-scrub.c b/gas/input-scrub.c index f5f2af214a..79e8de9196 100644 --- a/gas/input-scrub.c +++ b/gas/input-scrub.c @@ -1,5 +1,5 @@ /* input_scrub.c - Break up input buffers into whole numbers of lines. - Copyright (C) 1987-2016 Free Software Foundation, Inc. + Copyright (C) 1987-2018 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -487,6 +487,23 @@ new_logical_line (const char *fname, int line_number) } +/* Return the current physical input file name and line number, if known */ + +const char * +as_where_physical (unsigned int *linep) +{ + if (physical_input_file != NULL) + { + if (linep != NULL) + *linep = physical_input_line; + return physical_input_file; + } + + if (linep != NULL) + *linep = 0; + return NULL; +} + /* Return the current file name and line number. */ const char * @@ -499,16 +516,7 @@ as_where (unsigned int *linep) *linep = logical_input_line; return logical_input_file; } - else if (physical_input_file != NULL) - { - if (linep != NULL) - *linep = physical_input_line; - return physical_input_file; - } - else - { - if (linep != NULL) - *linep = 0; - return NULL; - } + + return as_where_physical (linep); } +