[all-commits] [llvm/llvm-project] 297230: [flang] Accept directive sentinels in macro-replac...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Oct 31 12:35:14 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 297230acdadd667fda379debd7dda20ace4f7213
      https://github.com/llvm/llvm-project/commit/297230acdadd667fda379debd7dda20ace4f7213
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2023-10-31 (Tue, 31 Oct 2023)

  Changed paths:
    M flang/lib/Parser/prescan.cpp
    M flang/lib/Parser/prescan.h
    M flang/lib/Parser/token-sequence.cpp
    M flang/lib/Parser/token-sequence.h
    A flang/test/Preprocessing/preprocessed-dirs.F90

  Log Message:
  -----------
  [flang] Accept directive sentinels in macro-replaced source better (#70699)

At present, the prescanner emits an error if a source line or compiler
directive, after macro replacement or not, contains a token with a
non-Fortran character. In the particular case of the '!' character, the
code that checks for bad character will accept the '!' if it appears
after a ';', since the '!' might begin a compiler directive.

This current implementation fails when a compiler directive appears
after some other character that might (by means of further source
processing not visible to the prescanner) be replaced with a ';' or
newline.

Extend the bad character check for '!' to actually check for a compiler
directive sentinel instead.




More information about the All-commits mailing list