[PATCH] D44181: Support resetting STATISTIC() values using llvm::ResetStatistics()
Daniel Sanders via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 7 11:58:34 PST 2018
dsanders added inline comments.
================
Comment at: unittests/ADT/StatisticTest.cpp:26
+ for (const auto &S : Range) {
+ if (std::string(S.first) == "Counter")
+ S1 = S;
----------------
bogner wrote:
> Isn't S.first a StringRef? Why do we need a std::string here for the comparison?
It was a `const char *` at one point. I'll fix this.
================
Comment at: unittests/ADT/StatisticTest.cpp:152-154
+ // No need to test the output ResetStatistics(), there's nothing to reset so
+ // we can't tell if it failed anyway.
+ ResetStatistics();
----------------
bogner wrote:
> Why bother even calling it if we're not testing anything?
I was on the fence about calling it. I decided to leave it there since it at least confirms that it doesn't crash.
Repository:
rL LLVM
https://reviews.llvm.org/D44181
More information about the llvm-commits
mailing list