Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation/DriverAndFrontend.md #763

Conversation

peterwaller-arm
Copy link
Collaborator

Add documentation describing the driver and frontend. I've also linked to it from the top of the overview, which seemed like a logical place to link to it from.

This is a work in progress and a request for comments.

I'm happy for this documentation to be merged as is, and we intend to update it on a regular basis.

I'm away on leave until 14th Oct. My colleagues may reply in the meantime.

See also: #762 ("Add flang -fc1").

Copy link
Contributor

@RichBarton-Arm RichBarton-Arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a nice overview of the driver project. I like the idea to create a minimum viable driver to replace the throwaway driver and re-use as much Clang code as we can without major surgery. I think the further refactoring to move generic code out of libClangDriver and investigate sharing DiagnosticHandlers and fs access classes can come along later and will be easier once the initial code is in place and once F18 makes it into LLVM.

I notice in your work in progress whittled statue in #762 that you have kept in all the diagnostics rendering code from Clang. On a conceptual level, it seems to me that having the new Flang frontend use existing Flang diagnostics code would be a more logical first step, so all of flang uses the same style of diagnostics. Obviously #762 is WIP, so is this a step you plan to take or would it be very hard to do this in the ex-clang frontend code and it would be easier to unify the two diagnostics handling code first?

individual driver options as early as possible. This requires putting a fair
amount of scaffolding in place.

Functionality can be reused from clang where it makes to do so. There are lots
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... makes sense to do so...

* flang & clang should be able to compile a mix of C and Fortran inputs by
invoking appropriate frontends. This is already handled by libclangDriver.
* flang --help should only list fortran-related options.
* Right now `TextDiagnosticPrinter` and related claseses live in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sp. classes

@CarolineConcatto
Copy link
Collaborator

Question:" On a conceptual level, it seems to me that having the new Flang frontend use existing Flang diagnostics code would be a more logical first step, so all of flang uses the same style of diagnostics."
Reply: I believe we do not have ATM a class Flang Diagnostic implemented in Flang as it is in Clang. Most errors and messages that the compiler emits are with the method Message &Say. As discussed in the future Flang would need a Diagnostic Client as the one we have in Clang.

Question:"Obviously #762 is WIP, so is this a step you plan to take or would it be very hard to do this in the ex-clang frontend code and it would be easier to unify the two diagnostics handling code first?"
Reply:Some progress of removing the dependency of Flang Driver Frontend from Clang Frontend was made in the #759. We intend to do similar for the #762 in the future.

@peterwaller-arm peterwaller-arm deleted the driver-and-frontend-doc branch January 11, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants