[flang-dev] [cfe-dev] RFC: refactoring clangDriver - diagnostics classes

Timothy Keith via flang-dev flang-dev at lists.llvm.org
Mon Nov 30 09:59:25 PST 2020


Regarding sharing a preprocessor between flang and clang, I think there wasn't much discussion about it because no one has an interest in doing it.

Preprocessing is superficially similar but Fortran has a lot of differences that would make sharing with clang very difficult.
Some examples of things a Fortran preprocessor has to handle:
- fixed form vs. free form and directives that switch between them
- preprocessor directives in all-caps in fixed form
- source lines truncated at or padded to 72 or 132 columns
- Fortran line continuations
- Hollerith constants and edit descriptors
- Fortran expressions in #if and #elif
- Fortran INCLUDE lines

There are more details about Fortran preprocessing here:
https://github.com/llvm/llvm-project/blob/master/flang/docs/Preprocessing.md

Tim

On 11/26/20, 9:04 AM, "flang-dev on behalf of Andrzej Warzynski via flang-dev" <flang-dev-bounces at lists.llvm.org on behalf of flang-dev at lists.llvm.org> wrote:

    External email: Use caution opening links or attachments


    On 25/11/2020 21:39, David Blaikie wrote:

    >
    > It sounded like Richard was saying in the other thread, that if flang
    > was going to share the integrated preprocessor - then the amount of
    > code shared would be quite large and maybe flang depending on clang
    > would be the right solution to that, if that's the direction we're
    > going in.

    Our goal has always been _just the driver_.

    In the follow-up RFC [1], we refined our plan and tried to emphasise
    that our plan is to:
      "Make libclangDriver independent of Clang".
    Richard's reply to that RFC [2]: "(...) this seems like a good direction
    to me". Hopefully Richard (CC'ed) can confirm that we didn't
    misinterpret that :)

    I don't think that Flang should depend on Clang. Also, that's something
    that was explicitly requested in one of our early patches for the new
    Flang driver [4]. And indeed, we committed ourselves to removing this
    dependency on flang-dev [5]. As for cfe-dev, in both [1] and [3] we
    proposed to move any shared code (in particular, libClangDriver) out of
    Clang. So again, no dependency on Clang.

    AFAIK, there are no plans to share the preprocessor and hence no
    discussion in that direction is happening. Obviously I can't speak for
    everyone on flang-dev, so I CC'ed that mailing list for better visibility.


    Thank you for your feedback!

    -Andrzej


    [1] http://lists.llvm.org/pipermail/cfe-dev/2020-July/066393.html
    [2] http://lists.llvm.org/pipermail/cfe-dev/2020-August/066488.html
    [3] http://lists.llvm.org/pipermail/llvm-dev/2020-June/141994.html
    [4] https://reviews.llvm.org/D79092
    [5] http://lists.llvm.org/pipermail/flang-dev/2020-July/000470.html
    _______________________________________________
    flang-dev mailing list
    flang-dev at lists.llvm.org
    https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-dev



More information about the flang-dev mailing list