1. Error messages would issue with the line number of %endrep.
2. Debug line information would ignore both macros and reps.
This is doubly wrong; macros are semantically equivalent to
inline functions, and it is expected that debuggers trace
into these functions.
These changes finishes the last parts of moving all responsibility for
the listing enable/disable into the preprocessor, so remove the
way over-complicated macro inhibit facility from the listing module
entirely.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
%line directives really need to be preprocessed early, before normal
directive processing. In particular, they are *not* affected by such
thing as smacro expansion, or deferred into an mmacro expansion.
The %line directive is special because it is explicitly indented to be
inserted by an external preprocessor, which can happen at any point.
For mmacro and rep expansions, store the current file and line for
each expansion line. Similarly, let each istk entry contain such
information.
Don't emit empty lines in preprocessing-only mode when we are
already required to issue a %line directive anyway. This cuts down on
clutter a fair bit.
Quote filenames in %line directives (and accept quoted filenames in
%line directives) if and only if it is necessary for
disambiguation. This is required if:
1. The filename contains control characters;
2. The filename begins or ends with whitespace or a quotation mark;
3. The filename is empty.
Otherwise issue the filename as-is, for backwards compatibility.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Simplify the srcfile subsystem by making it official that any pointer
passed to src_get() needs to have been obtained from the srcfile
subsystem itself.
Move a lot of the srcfile operations into inline code; often they
amount to a single machine instruction...
Signed-off-by: H. Peter Anvin <hpa@zytor.com>