diff options
author | Clement Courbet <courbet@google.com> | 2020-04-08 14:37:38 +0200 |
---|---|---|
committer | Clement Courbet <courbet@google.com> | 2020-04-08 15:37:30 +0200 |
commit | 9fb871866e2bb9b1c0968265bc5c1a3aa71d5845 (patch) | |
tree | eee301ee496b0fdf0299626ea5ce83d96018a9c8 /llvm/unittests/tools | |
parent | 625acd8f6847a156b236b8f11b4b02b11cac3766 (diff) | |
download | llvm-9fb871866e2bb9b1c0968265bc5c1a3aa71d5845.tar.gz |
[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.
Diffstat (limited to 'llvm/unittests/tools')
-rw-r--r-- | llvm/unittests/tools/llvm-exegesis/PerfHelperTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/unittests/tools/llvm-exegesis/PerfHelperTest.cpp b/llvm/unittests/tools/llvm-exegesis/PerfHelperTest.cpp index fa6f05c900b4..f4a07e8ebf5c 100644 --- a/llvm/unittests/tools/llvm-exegesis/PerfHelperTest.cpp +++ b/llvm/unittests/tools/llvm-exegesis/PerfHelperTest.cpp @@ -22,11 +22,11 @@ using ::testing::Not; TEST(PerfHelperTest, FunctionalTest) { #ifdef HAVE_LIBPFM ASSERT_FALSE(pfmInitialize()); - const PerfEvent Event("CYCLES:u"); + PerfEvent Event("CYCLES:u"); ASSERT_TRUE(Event.valid()); EXPECT_EQ(Event.name(), "CYCLES:u"); EXPECT_THAT(Event.getPfmEventString(), Not(IsEmpty())); - Counter Cnt(Event); + Counter Cnt(std::move(Event)); Cnt.start(); Cnt.stop(); Cnt.read(); |