[llvm] r341912 - [XRay] Ensure lambda outlives llvm::function_ref
Dean Michael Berris via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 17 17:03:17 PDT 2018
Yeah, that would have made it much simpler indeed.
On Tue, Sep 18, 2018 at 10:01 AM David Blaikie <dblaikie at gmail.com> wrote:
> Maybe TraceExpander should use std::function instead?
>
> On Tue, Sep 11, 2018 at 1:04 AM Dean Michael Berris via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: dberris
>> Date: Tue Sep 11 01:03:30 2018
>> New Revision: 341912
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=341912&view=rev
>> Log:
>> [XRay] Ensure lambda outlives llvm::function_ref
>>
>> Follow-up to D51912.
>>
>> Modified:
>> llvm/trunk/include/llvm/XRay/FDRTraceExpander.h
>> llvm/trunk/lib/XRay/Trace.cpp
>>
>> Modified: llvm/trunk/include/llvm/XRay/FDRTraceExpander.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/XRay/FDRTraceExpander.h?rev=341912&r1=341911&r2=341912&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/include/llvm/XRay/FDRTraceExpander.h (original)
>> +++ llvm/trunk/include/llvm/XRay/FDRTraceExpander.h Tue Sep 11 01:03:30
>> 2018
>> @@ -27,7 +27,7 @@ class TraceExpander : public RecordVisit
>> int32_t PID = 0;
>> int32_t TID = 0;
>> uint64_t BaseTSC = 0;
>> - XRayRecord CurrentRecord{};
>> + XRayRecord CurrentRecord{0, 0, RecordTypes::ENTER, 0, 0, 0, 0, {}};
>> uint16_t CPUId = 0;
>> uint16_t LogVersion = 0;
>> bool BuildingFunction = false;
>>
>> Modified: llvm/trunk/lib/XRay/Trace.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/XRay/Trace.cpp?rev=341912&r1=341911&r2=341912&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/XRay/Trace.cpp (original)
>> +++ llvm/trunk/lib/XRay/Trace.cpp Tue Sep 11 01:03:30 2018
>> @@ -317,8 +317,8 @@ Error loadFDRLog(StringRef Data, bool Is
>> return (L.WallclockTime->seconds() <
>> R.WallclockTime->seconds() &&
>> L.WallclockTime->nanos() < R.WallclockTime->nanos());
>> });
>> - TraceExpander Expander([&](const XRayRecord &R) {
>> Records.push_back(R); },
>> - FileHeader.Version);
>> + auto Adder = [&](const XRayRecord &R) { Records.push_back(R); };
>> + TraceExpander Expander(Adder, FileHeader.Version);
>> for (auto &B : Blocks) {
>> for (auto *R : B.Records)
>> if (auto E = R->apply(Expander))
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180918/92063bb9/attachment.html>
More information about the llvm-commits
mailing list