Skip to content

Conversation

kazutakahirata
Copy link
Contributor

std::list default-constructs itself as an empty list, so we don't need
to call ValueData.clear() in the constructor.

std::list default-constructs itself as an empty list, so we don't need
to call ValueData.clear() in the constructor.
@llvmbot llvmbot added the PGO Profile Guided Optimizations label Jun 11, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 11, 2024

@llvm/pr-subscribers-pgo

Author: Kazu Hirata (kazutakahirata)

Changes

std::list default-constructs itself as an empty list, so we don't need
to call ValueData.clear() in the constructor.


Full diff: https://github.com/llvm/llvm-project/pull/95143.diff

1 Files Affected:

  • (modified) llvm/include/llvm/ProfileData/InstrProf.h (+1-1)
diff --git a/llvm/include/llvm/ProfileData/InstrProf.h b/llvm/include/llvm/ProfileData/InstrProf.h
index d6831eeaa794b..dae2caf0181e4 100644
--- a/llvm/include/llvm/ProfileData/InstrProf.h
+++ b/llvm/include/llvm/ProfileData/InstrProf.h
@@ -797,7 +797,7 @@ struct InstrProfValueSiteRecord {
   /// Value profiling data pairs at a given value site.
   std::list<InstrProfValueData> ValueData;
 
-  InstrProfValueSiteRecord() { ValueData.clear(); }
+  InstrProfValueSiteRecord() = default;
   template <class InputIterator>
   InstrProfValueSiteRecord(InputIterator F, InputIterator L)
       : ValueData(F, L) {}

@kazutakahirata kazutakahirata merged commit 3af3525 into llvm:main Jun 11, 2024
@kazutakahirata kazutakahirata deleted the cleanup_InstrProfValueSiteRecord branch June 11, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PGO Profile Guided Optimizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants