Fix a bug freeing ProfData's ProfTransRecs
Summary: These were being freed in MCGenerator::translate() as soon as the TC
filled up. However, in retranslateOpt(), translate() is initially
called to generate the DV funclets along with the prologues before the
call to regionizeFunc(), which could cause the ProfData to be cleared
before regionizeFunc(). That could crash regionizeFunc() because it
still needs the ProfTransRecs in ProfData. This diff fixes the issue
by moving the call to ProfData::free() out of translate() and into
both retranslateOpt() and retranslate().
While here, also stop calling ProfData::freeFuncData(), which is now
unnecessary and simplifies the logic a tiny bit.
Reviewed By: @binliu19
Differential Revision:
D2529878
fb-gh-sync-id:
3405b53db28c91d16e55a5ee281b2ec5d43e10f4