This is an archive of the discontinued LLVM Phabricator instance.

[TimeProfiler] Reset variable to nullptr
ClosedPublic

Authored by smeenai on Oct 30 2021, 4:55 PM.

Details

Summary

Otherwise we'll hit a spurious assert failure when we reset and then
reinitialize TimeProfiler on the same thread, as can happen when e.g.
using LLD as a library and running it multiple times in the same
process.

Makes lld/test/MachO/time-trace.s pass with LLD_IN_TEST=2, which
runs the linker twice in the same process and exposed the issue.

Diff Detail