[all-commits] [llvm/llvm-project] 4299d9: [flang] Accomodate historic preprocessing usage (#...

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Jan 25 16:01:09 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4299d9b1af45843fd3230dc429fcf9cc19460303
      https://github.com/llvm/llvm-project/commit/4299d9b1af45843fd3230dc429fcf9cc19460303
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    M flang/lib/Parser/prescan.cpp
    M flang/lib/Parser/prescan.h
    A flang/test/Preprocessing/pp133.F90

  Log Message:
  -----------
  [flang] Accomodate historic preprocessing usage (#78868)

Some Fortran codes use line continuation as a form of token pasting; see
https://github.com/llvm/llvm-project/issues/78797. This works in
compilers that run a C-like preprocessor and then apply line
continuation to its output; f18 implements line continuation during
tokenization and preprocessing, but can still handle this case.

In the rare case when an identifier is split across two or more
continuation lines, this patch allows its parts to be distinct
preprocessing tokens for the purpose of macro replacemnt. They (or their
replacement texts) can be effectively rejoined later as a single
identifier when the cooked character stream is tokenized in parsing.

Fixes https://github.com/llvm/llvm-project/issues/78797.




More information about the All-commits mailing list