[llvm-exegesis][NFC] Let the pfm::Counter own the PerfHelper.
authorClement Courbet <courbet@google.com>
Wed, 8 Apr 2020 12:37:38 +0000 (14:37 +0200)
committerClement Courbet <courbet@google.com>
Wed, 8 Apr 2020 13:37:30 +0000 (15:37 +0200)
commit9fb871866e2bb9b1c0968265bc5c1a3aa71d5845
treeeee301ee496b0fdf0299626ea5ce83d96018a9c8
parent625acd8f6847a156b236b8f11b4b02b11cac3766
[llvm-exegesis][NFC] Let the pfm::Counter own the PerfHelper.

A perf helper is always only ever cretaed to be checked for validity
then passed as Counter ctor argument, never to be touched again.
Its lifetime should outlive that of the counter, and there is never any
reason to have two different counters of top of the perf helper.
Make sure these assumptions always hold by making the Counter consume the
PerfHelper.
llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
llvm/tools/llvm-exegesis/lib/PerfHelper.cpp
llvm/tools/llvm-exegesis/lib/PerfHelper.h
llvm/unittests/tools/llvm-exegesis/PerfHelperTest.cpp