This is an archive of the discontinued LLVM Phabricator instance.

[trace] Replace TraceCursorUP with TraceCursorSP
ClosedPublic

Authored by jj10306 on Aug 1 2022, 11:50 AM.

Details

Summary

The use of std::unique_ptr with TraceCursor adds unnecessary complexity to adding SBTraceCursor bindings
Specifically, since TraceCursor is an abstract class there's no clean
way to provide "deep clone" semantics for TraceCursorUP short of
creating a pure virtual clone() method (afaict).

After discussing with @wallace, we decided there is no strong reason to
favor wrapping TraceCursor with std::unique_ptr over std::shared_ptr, thus this diff
replaces all usages of std::unique_ptr<TraceCursor> with std::shared_ptr<TraceCursor>.

This sets the stage for future diffs to introduce SBTraceCursor
bindings in a more clean fashion.

This diff will be landed after D130924 is landed.

Diff Detail

Event Timeline

jj10306 created this revision.Aug 1 2022, 11:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 11:50 AM
jj10306 requested review of this revision.Aug 1 2022, 11:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 11:50 AM
jj10306 edited the summary of this revision. (Show Details)Aug 1 2022, 11:50 AM
wallace accepted this revision.Aug 1 2022, 12:10 PM

great! that will make all the bindings very easy to handle

This revision is now accepted and ready to land.Aug 1 2022, 12:10 PM
This revision was automatically updated to reflect the committed changes.