Reapply "Revert "[func-sig-opts] If we know all callsites of a function, delete the old unoptimized function instead of creating a thunk.""

This reverts commit r23725. This time with fixes so we don't hit that
assertion.

Swift SVN r23762
This commit is contained in:
Michael Gottesman
2014-12-06 23:08:17 +00:00
parent 3f46b30ca4
commit cb8760148d
3 changed files with 58 additions and 8 deletions

View File

@@ -154,6 +154,10 @@ public:
return LoweredType;
}
bool canBeDeleted() const {
return !getRefCount() && !isZombie();
}
/// Return the number of entities referring to this function (other
/// than the SILModule).
unsigned getRefCount() const { return RefCount; }