[all-commits] [llvm/llvm-project] 4a3e4b: [flang] Adjust prescanner fix for preprocessing (#...
Peter Klausler via All-commits
all-commits at lists.llvm.org
Tue Jan 14 13:01:52 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4a3e4b99b9ab3016afe8b02c4f83f24635964f4e
https://github.com/llvm/llvm-project/commit/4a3e4b99b9ab3016afe8b02c4f83f24635964f4e
Author: Peter Klausler <pklausler at nvidia.com>
Date: 2025-01-14 (Tue, 14 Jan 2025)
Changed paths:
M flang/lib/Parser/prescan.cpp
M flang/test/Preprocessing/bug129131.F
Log Message:
-----------
[flang] Adjust prescanner fix for preprocessing (#122779)
Commas being optional in FORMAT statements, the tokenization of things
like 3I9HHOLLERITH is tricky. After tokenizing the initial '3', we don't
want to then take apparent identifier "I9HHOLLERITH" as the next token.
So the prescanner just consumes the letter ("I") as its own token in
this context.
A recent bug report complained that this can lead to incorrect results
when (in this case) the letter is a defined preprocessing macro. I
updated the prescanner to check that the letter is actually followed by
an instance of a problematic Hollerith literal.
And this broke two tests in the Fujitsu Fortran test suite that Linaro
runs, as it couldn't detect a following Hollerith literal that wasn't on
the same source line. We can't do look-ahead line continuation
processing in NextToken(), either.
So here's a second attempt at fixing the original problem: namely, the
letter that follows a decimal integer token is checked to see whether
it's the name of a defined macro.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list