[PATCH] D19725: [Coverage] Fix an issue where a coverage region might not be created for a macro containing for or while statements.
David Li via cfe-commits
cfe-commits at lists.llvm.org
Sun May 1 00:21:21 PDT 2016
davidxl accepted this revision.
davidxl added a comment.
This revision is now accepted and ready to land.
lgtm
================
Comment at: lib/CodeGen/CoverageMappingGen.cpp:468
@@ +467,3 @@
+ MostRecentLocation == getEndOfFileOrMacro(MostRecentLocation) &&
+ isRegionAlreadyAdded(getStartOfFileOrMacro(MostRecentLocation),
+ MostRecentLocation))
----------------
Perhaps add a comment here that there is need to create 'outer most' code region for while/for stmt('s virtual file) with counter equal to the parent/enclosing scope's counter. The expansion region's counter will be copied from it during coverage reading. Also refer to handleFileExit where the region is created.
http://reviews.llvm.org/D19725
More information about the cfe-commits
mailing list