[gcov] Sort file info before printing it
authorVedant Kumar <vsk@apple.com>
Wed, 26 Apr 2017 00:16:10 +0000 (00:16 +0000)
committerVedant Kumar <vsk@apple.com>
Wed, 26 Apr 2017 00:16:10 +0000 (00:16 +0000)
commit77deb5c7880c18c2e1112e508c1091bc3d872516
tree0ca032935efd61e273811c6cb6defc78c4696450
parentc5e84f14a22c8b5ea6e43f4ce675876afe67f2b5
[gcov] Sort file info before printing it

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.

Differential Revision: https://reviews.llvm.org/D32512

llvm-svn: 301371
llvm/lib/IR/GCOV.cpp
llvm/test/tools/llvm-cov/Inputs/test_-b.output
llvm/test/tools/llvm-cov/Inputs/test_-f.output
llvm/test/tools/llvm-cov/Inputs/test_long_file_names.output
llvm/test/tools/llvm-cov/Inputs/test_long_paths.output
llvm/test/tools/llvm-cov/Inputs/test_missing.output
llvm/test/tools/llvm-cov/Inputs/test_no_gcda.output
llvm/test/tools/llvm-cov/Inputs/test_no_options.output
llvm/test/tools/llvm-cov/Inputs/test_no_output.output
llvm/test/tools/llvm-cov/Inputs/test_no_preserve_paths.output
llvm/test/tools/llvm-cov/Inputs/test_preserve_paths.output