[Support] Drop unnecessary const from a return type (NFC)

Identified with readability-const-return-type.
This commit is contained in:
Kazu Hirata 2022-08-14 12:51:56 -07:00
parent 8b9b45ce54
commit 9144e49334
3 changed files with 4 additions and 4 deletions

View File

@ -200,7 +200,7 @@ void PrintStatisticsJSON(raw_ostream &OS);
/// during it's execution. It will return the value at the point that it is
/// read. However, it will prevent new statistics from registering until it
/// completes.
const std::vector<std::pair<StringRef, uint64_t>> GetStatistics();
std::vector<std::pair<StringRef, uint64_t>> GetStatistics();
/// Reset the statistics. This can be used to zero and de-register the
/// statistics in order to measure a compilation.

View File

@ -253,7 +253,7 @@ void llvm::PrintStatistics() {
#endif
}
const std::vector<std::pair<StringRef, uint64_t>> llvm::GetStatistics() {
std::vector<std::pair<StringRef, uint64_t>> llvm::GetStatistics() {
sys::SmartScopedLock<true> Reader(*StatLock);
std::vector<std::pair<StringRef, uint64_t>> ReturnStats;

View File

@ -128,7 +128,7 @@ TEST(StatisticTest, API) {
// It should empty the list and zero the counters.
ResetStatistics();
{
auto &Range = GetStatistics();
auto Range = GetStatistics();
EXPECT_EQ(Range.begin(), Range.end());
EXPECT_EQ(Counter, 0u);
EXPECT_EQ(Counter2, 0u);
@ -144,7 +144,7 @@ TEST(StatisticTest, API) {
Counter2++;
{
auto &Range = GetStatistics();
auto Range = GetStatistics();
EXPECT_EQ(Range.begin() + 2, Range.end());
EXPECT_EQ(Counter, 1u);
EXPECT_EQ(Counter2, 1u);