This is an archive of the discontinued LLVM Phabricator instance.

[Lex] Fix `fixits` for typo-corrections of preprocessing directives within skipped blocks
ClosedPublic

Authored by akyrtzi on Jun 7 2022, 1:41 PM.

Details

Summary

The EndLoc parameter was always unset so no fixit was emitted. But it is also unnecessary for determining the range so we can remove it.

Diff Detail

Event Timeline

akyrtzi created this revision.Jun 7 2022, 1:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 1:41 PM
akyrtzi requested review of this revision.Jun 7 2022, 1:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 1:41 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
akyrtzi updated this revision to Diff 434940.Jun 7 2022, 1:51 PM

No need to add '#' for the fixit since we have the range of the directive identifier to fix.

akyrtzi updated this revision to Diff 434959.Jun 7 2022, 2:28 PM

Remove the parameter from documentation comment as well.

akyrtzi updated this revision to Diff 434980.Jun 7 2022, 3:58 PM

Disable clang-format checks for the test file.

aaron.ballman accepted this revision.Jun 9 2022, 9:55 AM

Good catch, thank you for fixing this up! LGTM!

clang/test/Preprocessor/suggest-typoed-directive.c
14–15

You can remove this -- we don't require test files to be formatted properly, and formatting comments can quickly become distracting.

This revision is now accepted and ready to land.Jun 9 2022, 9:55 AM
akyrtzi added inline comments.Jun 9 2022, 2:08 PM
clang/test/Preprocessor/suggest-typoed-directive.c
14–15

The debian bot failed for this patch with clang-format complaining about the test file. Was this unintentional?

akyrtzi added inline comments.Jun 9 2022, 2:20 PM
clang/test/Preprocessor/suggest-typoed-directive.c
14–15
aaron.ballman added inline comments.Jun 10 2022, 11:37 AM
clang/test/Preprocessor/suggest-typoed-directive.c
14–15

Yeah -- the precommit CI bots still check it and report back failures, which is incredibly frustrating given how much noise that generates. I've filed https://github.com/llvm/llvm-project/issues/55982 to track that.

akyrtzi updated this revision to Diff 436024.Jun 10 2022, 1:20 PM

Remove // clang-format off annotation.

akyrtzi marked 2 inline comments as done.Jun 10 2022, 1:21 PM
This revision was landed with ongoing or failed builds.Jun 10 2022, 1:32 PM
This revision was automatically updated to reflect the committed changes.