Exposing a non-const accessor for clearing CallsiteSamples during flattening is a big of an overkill. Replace the non-const accessor with removeAllCallsiteSamples.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/ProfileData/SampleProf.h | ||
---|---|---|
806 | Consider "the swap trick" to guarantee that we free the memory? CallsiteSamplesMap EmptyCallsiteSamples; std::swap(CallsiteSamples, EmptyCallsiteSamples); |
llvm/include/llvm/ProfileData/SampleProf.h | ||
---|---|---|
806 | It's a std::map, so clear should be sufficient. |
Consider "the swap trick" to guarantee that we free the memory?