Improve Clang Diagnostics

Improve Clang Diagnostics

Clang Diagnostics, which issues Warnings and Errors to the programmer, are a critical feature of the compiler. Great diagnostics can have a significant impact on the user experience of the compiler and increase their productivity.

Recent improvements in GCC [1] [2] shows that there is significant headroom to improve diagnostics (and user interactions in general). It would be a very impactful project to survey and identify all the possible improvements to clang on this topic and start redesigning the next generation of our diagnostics.

In addition, we will also make conclusions on issues reported on the LLVM Github Issue page labeled
with clang-diagnostics and if they need fixing, we will prepare patches otherwise simply close them.

Expected outcomes

Diagnostics will be improved:

  • Improve diagnostic aesthetics
  • Cover missing diagnostics
  • Reduce false positive rate
  • Reword diagnostics

Desirable skills

Intermediate knowledge of C++

Project type

Large/350 hr

Mentors:

@AaronBallman, @erichkeane, @Shivam

4 Likes

Hi, I am interested to contribute in this. I have intermediate knowledge about C++, Can you kindly guide me how we will be working to improve the diagnostics?

Hi,I am interested in working on this topic as I have familiarity with diagnostics.I am working on the compiler dev domain itself and have a exposure to it.I have build clang from source and will checkout the source code of diagnostics.I am having a decent experience in C++.I am familiar to gcc compiler flags and optimization levels as well.I will just glance through the clang flags and get accustomed to it.Any suggestions how to proceed?

Hi Usman, Hi Krishna,

Thank you for your interest in the project and Welcome to the LLVM community!

I think you can start with a simple exercise like first building clang from the source. Run any simple c program that gives you some warning. then try grepping that warning text in clang source. Usually, it can be found in clang/include/clang/Basic/DiagnosticSemaKinds.td or similar td(TableGen) file. try changing that text. Then rebuild the clang, rerun that c program again to see if the exercise is completed :slight_smile:

Then can try browsing clang-diagnostics bugs on the GitHub Issue page. Some issues only require rewording the warning/error. They can give you how it going to feel to work on this project. Put a comment or ask questions there if you would to work on that issue.

The linked blogs in the above first post contain a nice summary of things that can enhance/improve the user experience. Compare the Clang results with GCC. If you found any feature that improves the programmer’s experience, discuss it here and include that in your GSoC proposal. We will be very flexible on what you would like to work on improving diagnostics and welcome all ideas.

Feel free to ask if need help or have any questions :slight_smile:

Thanks,
Shivam

1 Like

Hi Shivam
where can i submit my proposal for earlier review from you?

Thanks
Usman

Hi Usman,

You can send your proposal as Google docs under Clang-Frontend category like this one.

Btw if you search llvm-dev mailing list archives with GSoC keyword, you may find some older GSoC student/intern proposals, good to get some idea for writing your one.

Thanks,
Shivam

1 Like

ok, Thank you