================ @@ -104,6 +105,23 @@ struct llvm::TimeTraceProfilerEntry { } }; +struct InProgressEntry { + std::unique_ptr<TimeTraceProfilerEntry> Event; + std::vector<TimeTraceProfilerEntry> InstantEvents; + + InProgressEntry(TimePointType &&S, TimePointType &&E, std::string &&N, + std::string &&Dt, TimeTraceEventType Et) + : Event(std::make_unique<TimeTraceProfilerEntry>( + std::move(S), std::move(E), std::move(N), std::move(Dt), Et)), + InstantEvents() {} + + InProgressEntry(TimePointType &&S, TimePointType &&E, std::string &&N, ---------------- ilya-biryukov wrote:
I suggested to remove the constructors completely, but also wanted to mention that it's better to accept by value in constructors, r-value references are almost always the wrong choice. If the value is used, users still have a chance to `std::move()` into it to get efficiency; but they're also allowed to copy in cases where the type is const or a copy is actually needed. See https://gcc.godbolt.org/z/9s3oo6xz8 for some examples. https://github.com/llvm/llvm-project/pull/103039 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits