This is an archive of the discontinued LLVM Phabricator instance.

[Clang][CoverageMapping] Fix compile time explosions by adjusting only appropriated skipped ranges
ClosedPublic

Authored by bruno on Jun 8 2022, 12:48 PM.

Details

Summary

D83592 added comments to be part of skipped regions, and as part of that, it
also shrinks a skipped range if it spans a line that contains a non-comment
token. This is done by adjustSkippedRange.

The adjustSkippedRange currently runs on skipped regions that are not
comments, causing a 5min regression while building a big C++ files without any
comments.

Fix the compile time introduced in D83592 by tagging SkippedRange with kind
information and use that to decide what needs additional processing. There are
no good way to add a testcase for this that I'm aware.

Diff Detail

Event Timeline

bruno created this revision.Jun 8 2022, 12:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 12:48 PM
Herald added subscribers: hoy, modimo, wenlei. · View Herald Transcript
bruno requested review of this revision.Jun 8 2022, 12:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2022, 12:48 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
zequanwu accepted this revision.Jun 8 2022, 2:06 PM

LGTM, thanks.

This revision is now accepted and ready to land.Jun 8 2022, 2:06 PM

Just noticed that 3 test cases failed. Please fix them before landing.

bruno added a comment.Jun 8 2022, 2:08 PM

Just noticed that 3 test cases failed. Please fix them before landing.

Sure thing, thanks!

bruno updated this revision to Diff 435388.Jun 8 2022, 4:49 PM

Empty lines handling should also make it skipped, fix the 3 failures.