This is an archive of the discontinued LLVM Phabricator instance.

[AST] Convert Marshallers to use unique_ptr.
ClosedPublic

Authored by jlebar on Oct 9 2016, 10:25 PM.

Event Timeline

jlebar updated this revision to Diff 74103.Oct 9 2016, 10:25 PM
jlebar retitled this revision from to [AST] Convert Marshallers to use unique_ptr..
jlebar updated this object.
jlebar added a reviewer: timshen.
jlebar added a subscriber: cfe-commits.
timshen added inline comments.Oct 10 2016, 2:12 AM
clang/lib/ASTMatchers/Dynamic/Marshallers.h
514

Notice that this is 2x slower, because move on unique_ptr resets the move-from side. But it is less likely to have an issue.

clang/lib/ASTMatchers/Dynamic/Registry.cpp
501

const MatcherDescriptor &Matcher = *M.getValue()?

jlebar marked 2 inline comments as done.Oct 10 2016, 9:03 AM
jlebar added inline comments.
clang/lib/ASTMatchers/Dynamic/Marshallers.h
514

It may be even worse than that because we used to be able to do memcpy, but now, unless llvm is incredibly smart, we're forced to copy one element at a time.

I think these lists are at most two elements, though.

timshen accepted this revision.Oct 10 2016, 8:35 PM
timshen edited edge metadata.
This revision is now accepted and ready to land.Oct 10 2016, 8:35 PM
This revision was automatically updated to reflect the committed changes.
jlebar marked an inline comment as done.