llvm-profdata: Reduce memory usage by using Error callback rather than member
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 10 Jul 2017 03:04:59 +0000 (03:04 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 10 Jul 2017 03:04:59 +0000 (03:04 +0000)
commit98cce00371d271c9da8de806e4cc4c886a85d56c
tree7bf32e24c96e9efc62e1c316ab80b595c02a5fba
parent625cc0ecaf2621cc779780826922e012502e2fa6
llvm-profdata: Reduce memory usage by using Error callback rather than member

Reduces llvm-profdata memory usage on a large profile from 7.8GB to 5.1GB.

The ProfData API now supports reporting all the errors/warnings rather
than only the first, though llvm-profdata ignores everything after the
first for now to preserve existing behavior. (if there's a desire for
other behavior, happy to implement that - but might be as well left for
a separate patch)

Reviewers: davidxl

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

llvm-svn: 307516
llvm/include/llvm/ProfileData/InstrProf.h
llvm/include/llvm/ProfileData/InstrProfWriter.h
llvm/lib/ProfileData/InstrProf.cpp
llvm/lib/ProfileData/InstrProfWriter.cpp
llvm/tools/llvm-profdata/llvm-profdata.cpp
llvm/unittests/ProfileData/CoverageMappingTest.cpp
llvm/unittests/ProfileData/InstrProfTest.cpp