[SIL] Reallocate temporary SILFunction names to live in SILModule.

This commit is contained in:
Graydon Hoare
2018-05-29 00:26:37 -07:00
parent 1c87229104
commit 3b76f007d6
4 changed files with 12 additions and 7 deletions

View File

@@ -312,7 +312,8 @@ BridgedProperty::outline(SILModule &M) {
// Get the function type.
auto FunctionType = getOutlinedFunctionType(M);
std::string name = getOutlinedFunctionName();
std::string nameTmp = getOutlinedFunctionName();
auto name = M.allocateCopy(nameTmp);
auto *Fun = FuncBuilder.getOrCreateFunction(
ObjCMethod->getLoc(), name, SILLinkage::Shared, FunctionType, IsNotBare,
@@ -922,7 +923,8 @@ std::pair<SILFunction *, SILBasicBlock::iterator>
ObjCMethodCall::outline(SILModule &M) {
auto FunctionType = getOutlinedFunctionType(M);
std::string name = getOutlinedFunctionName();
std::string nameTmp = getOutlinedFunctionName();
auto name = M.allocateCopy(nameTmp);
auto *Fun = FuncBuilder.getOrCreateFunction(
ObjCMethod->getLoc(), name, SILLinkage::Shared, FunctionType, IsNotBare,