This is an archive of the discontinued LLVM Phabricator instance.

[gcov] Sort file info before printing it
ClosedPublic

Authored by vsk on Apr 25 2017, 5:16 PM.

Details

Summary

The order in which GCOV file info is printed depends on the string hash
function. This makes some GCOV tests brittle, because the tests must be
updated whenever the hash function changes.

Sort the filenames before printing out the file info to solve the
problem. This should be relatively cheap.

Diff Detail

Event Timeline

vsk created this revision.Apr 25 2017, 5:16 PM
scott.smith accepted this revision.Apr 25 2017, 5:22 PM
scott.smith added inline comments.
lib/IR/GCOV.cpp
592

Personally I wouldn't bother with SmallVector; you'll probably get more mileage just specifying how many entries to expect by calling vector::reserve(LineInfo.size()).

I'm sure it's all noise either way though.

This revision is now accepted and ready to land.Apr 25 2017, 5:22 PM
This revision was automatically updated to reflect the committed changes.