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

Andrzej Warzynski via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 25 08:26:27 PST 2020



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?

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