OSDN Git Service

InstrProf: Simplify counting a file's regions when writing coverage (NFC)
authorJustin Bogner <mail@justinbogner.com>
Thu, 2 Oct 2014 00:31:00 +0000 (00:31 +0000)
committerJustin Bogner <mail@justinbogner.com>
Thu, 2 Oct 2014 00:31:00 +0000 (00:31 +0000)
commit3cef611ebd79fb1ccd29d628164849d1a6048992
tree20f6f6ad99a5d9601d0413f81fc71cf79b40b18a
parent4bbf21e71e0b639353710fbbc4ee479cb7072364
InstrProf: Simplify counting a file's regions when writing coverage (NFC)

When writing a coverage mapping we iterate through the mapping regions
in order of FileID, but we were then repeatedly searching from the
beginning of the list to count the number of regions with a given
FileID.

It is simpler and more efficient to search forward from the current
iterator to find the number of regions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218842 91177308-0d34-0410-b5e6-96231b3b80d8
lib/ProfileData/CoverageMappingWriter.cpp