This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Fix incorrect link to "note" diagnostics in HTML output
ClosedPublic

Authored by gruuprasad on Jul 31 2023, 11:26 AM.

Details

Summary

IDs of the note list start from 1. Link generated for each note started with index 0 i.e #Note0, #Note1 and so on.
As a result, first link ("#Note0") was invalid, subsequent links pointed at wrong note.
Now, generated links to the notes start with index 1 i.e (#Note1, #Note2 and so on.

github issue link: https://github.com/llvm/llvm-project/issues/64054
Tested generated HTML output manually for correctness.

Diff Detail

Event Timeline

gruuprasad created this revision.Jul 31 2023, 11:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2023, 11:26 AM
gruuprasad requested review of this revision.Jul 31 2023, 11:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2023, 11:26 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
gruuprasad edited the summary of this revision. (Show Details)Jul 31 2023, 11:31 AM
gruuprasad edited the summary of this revision. (Show Details)Jul 31 2023, 11:50 AM

Could you please add a test for the patch?

Sure, Initially I didn't find the folder StaticAnalysis in the clang/test folder, found that relevant tests are in test/Analysis.

Sure, Initially I didn't find the folder StaticAnalysis in the clang/test folder, found that relevant tests are in test/Analysis.

Correct, thanks!

I went through the build logs, but failed test (Clang :: Driver/fsanitize.c) seems to be irrelevant to the changes in this patch.

clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
596–600

git clang-format suggests formatting this block of code, but kept them as is since I didn't modify this part.

steakhal accepted this revision.Aug 3 2023, 1:35 AM

Looks correct.
Please merge it.

This revision is now accepted and ready to land.Aug 3 2023, 1:35 AM

@steakhal, ok, this is my first contribution, I don't have the commit access yet.
Can you please merge this?

@steakhal, ok, this is my first contribution, I don't have the commit access yet.
Can you please merge this?

What should be the commit author?

gruuprasad added a comment.EditedAug 3 2023, 2:20 AM

Email:gruuprasada@gmail.com
GitHub username: gruuprasad
Either of these fine.

Thank you!

This revision was landed with ongoing or failed builds.Aug 3 2023, 2:44 AM
This revision was automatically updated to reflect the committed changes.
steakhal retitled this revision from [StaticAnalyzer] Fix incorrect link to "note" diagnostics in HTML output to [analyzer] Fix incorrect link to "note" diagnostics in HTML output.Aug 3 2023, 2:45 AM