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

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 25 13:39:54 PST 2020


On Wed, Nov 25, 2020 at 8:26 AM Andrzej Warzynski
<andrzej.warzynski at arm.com> wrote:
>
>
>
> On 24/11/2020 20:18, David Blaikie wrote:
> > On Tue, Nov 24, 2020 at 10:58 AM Andrzej Warzynski
> > <andrzej.warzynski at arm.com> wrote:
> >>
> >>
> >>
> >> On 24/11/2020 18:00, David Blaikie wrote:
> >>>
> >>> Sorry for the slight distraction, but what's the plan for Flang's
> >>> diagnostics? Might it benefit from Clang's diagnostic infrastructure
> >>> for tracking source locations, etc?
> >>>
> >>
> >> No worries. We discussed this briefly in the past (see e.g. [1]). AFAIK,
> >> there are no plans to share diagnostics infra between Clang and Flang.
> >>
> >> Diagnostics (and SourceLocation) in Clang are tuned for C-family
> >> languages. Generalising that code would be non-trivial. Personally I
> >> think that such code re-use would be great, but sadly we wouldn't be
> >> able to commit to such refactoring anytime soon.
> >>
> >> [1] http://lists.llvm.org/pipermail/llvm-dev/2020-June/142024.html
> >
> > Hmm - given the answer here:
> > http://lists.llvm.org/pipermail/llvm-dev/2020-June/142048.html - I
> > wonder whether it's likely there should/would be more code reuse.
> > Sharing the whole integrated assembler between clang and flang? I
> > don't see further discussion on that branch of the thread engaging
> > with that idea.
> >
>
>
> Thank you for your reply. I appreciate that there are other important
> parts of the toolchain that we haven't discussed in much detail yet. For
> now we've been focusing on the driver. Are you suggesting that perhaps
> we shouldn't be sharing/re-using clangDriver? Or have a broader
> discussion about other infrastructure instead?

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.

But I didn't see any discussion of if flang would share that, or if
not, why not. If it is going to - then the driver refactoring may be
unnecessary, because the goal of flang not depending on clang might
not be suitable in a future in which flang shares clang's
preprocessor.

> I'm just trying to understand whether we've missed some important step
> or dependency here. From what we've seen and discussed so far, it seems
> that making clangDriver independent of Clang would be beneficial for
> both Clang and Flang.
>
> Btw, we continued the original discussion in this follow-up RFC:
> * http://lists.llvm.org/pipermail/cfe-dev/2020-July/066393.html
>
>
> -Andrzej


More information about the cfe-dev mailing list