Split up Func append and copy operations
commitbe6144972c1eec040211b83e868d9b7c2322d454
authorShaunak Kishore <kshaunak@fb.com>
Thu, 13 Aug 2020 20:22:05 +0000 (13 13:22 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 13 Aug 2020 20:25:05 +0000 (13 13:25 -0700)
treecd11fc5a99e4c2cd82c973f92cf45fbc2422db3d
parent7e0f846810bf3dca247f8d32c2c50a4935eff22b
Split up Func append and copy operations

Summary:
We do some hacky things to copy a FuncBase, in order to share code with the append operation. There's no reason to do that; FuncBase can just be copied directly.

The new "!blocks.empty()" assertions in the copy_into helper aren't required for correctness, but they should always pass for the append case and they confirm that we're not creating new copies of blocks that were shared before.

Reviewed By: ricklavoie

Differential Revision: D23109829

fbshipit-source-id: 65dab505029fc793f20682b0d48c64459fbd9285
hphp/hhbbc/func-util.cpp