This is an archive of the discontinued LLVM Phabricator instance.

[Coverage] Support for C++17 switch initializers
ClosedPublic

Authored by vsk on Oct 12 2016, 6:25 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

vsk updated this revision to Diff 74462.Oct 12 2016, 6:25 PM
vsk retitled this revision from to [Coverage] Support for C++17 switch initializers.
vsk updated this object.
vsk added reviewers: arphaman, ikudrin.
vsk added a subscriber: cfe-commits.
arphaman edited edge metadata.Oct 13 2016, 6:49 AM

I'm unsure about whether or not the CodeGenPGO change in this patch deserves more testing.

It wouldn't harm to add a test for CodeGenPGO as well. A good test that you can as a starting point for the new one is test/Profile/cxx-rangefor.cpp. A single PGOGEN check for a PGO counter generated from a subexpression in a switch initializer should be sufficient.

lib/CodeGen/CoverageMappingGen.cpp
818 ↗(On Diff #74462)

I noticed that you added a newline here, wouldn't it be better to have it after extendRegion(S) so that the Visit calls are grouped together?

vsk updated this revision to Diff 74552.Oct 13 2016, 11:11 AM
vsk updated this object.
vsk edited edge metadata.

Per @arphaman's comments:

  • Add a CodeGenPGO test which checks whether counters can be created for statements inside of switch initializers.
  • Group calls to 'Visit' together.
ikudrin accepted this revision.Oct 14 2016, 7:07 AM
ikudrin edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 14 2016, 7:07 AM
This revision was automatically updated to reflect the committed changes.
cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp