[func-sig-opts] Add the call SILFunction::spliceBody() to splice a function's body onto another function.

I also added code to ilist_traits so we can set the parent function on BB to be the new function.

Swift SVN r21729
This commit is contained in:
Michael Gottesman
2014-09-04 23:34:34 +00:00
parent 1b8ed882d3
commit 225a5ca87b
4 changed files with 47 additions and 7 deletions

View File

@@ -79,6 +79,10 @@ SILFunction::SILFunction(SILModule &Module, SILLinkage Linkage,
Module.functions.insert(SILModule::iterator(InsertBefore), this);
else
Module.functions.push_back(this);
// Set our BB list to have this function as its parent. This enables us to
// splice efficiently basic blocks in between functions.
BlockList.Parent = this;
}
SILFunction::~SILFunction() {