This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add --enable-module-headers-parsing option
ClosedPublic

Authored by PiotrZSL on Jul 24 2023, 12:13 PM.

Details

Summary

Change default behavior in Clang-tidy and skip by default
module headers parsing. That functionality is buggy and
slow in C++20, and provide tiny benefit.

Diff Detail

Event Timeline

PiotrZSL created this revision.Jul 24 2023, 12:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 12:13 PM
PiotrZSL requested review of this revision.Jul 24 2023, 12:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 12:13 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Please squash into previous patch, I see no reason to make them into separate commits. The first one is missing Release Notes, for example.

@carlosgalvezp
My plan was to push first change regardless (so they would be some workaround, even if hidden & undocumented), and second only if approved.

PiotrZSL updated this revision to Diff 543708.Jul 24 2023, 3:03 PM
PiotrZSL retitled this revision from [clang-tidy] Add --experimental-enable-module-headers-parsing option to [clang-tidy] Add --enable-module-headers-parsing option.
PiotrZSL edited the summary of this revision. (Show Details)

Merge with other change, remove experimental

Do we want to keep the experimental word in the flag?

clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
266

--experimental-enable-module-headers-parsing

270

Should we document the implications/risks of enabling this, so people are informed? Also the fact that is experimental and subject to change.

clang-tools-extra/docs/ReleaseNotes.rst
109

experimental

PiotrZSL added inline comments.Jul 25 2023, 1:45 AM
clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
266

I removed 'experimental' because it were messing with the --help output, were causing it be very wide.
And it's no longer hidden option now. so should it be hidden & experimental ? Or non hidden...

270

Something like "May cause performance & parsing issues, and therefore is considered experimental." ? I'ts fine with me.

carlosgalvezp accepted this revision.Jul 25 2023, 5:30 AM

LGTM! Feel free to add the comment about the implications of using the flag in the docs.

clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
270

Sounds good to me!

This revision is now accepted and ready to land.Jul 25 2023, 5:30 AM
PiotrZSL marked 2 inline comments as done.Jul 25 2023, 10:41 AM
carlosgalvezp accepted this revision.Jul 25 2023, 10:53 AM
This revision was landed with ongoing or failed builds.Jul 25 2023, 11:31 AM
This revision was automatically updated to reflect the committed changes.