Implement inline scopes for the performance inliner.

Mandatory-inlined (aka transparent functions) are still treated as if they
had the location and scope of the call site. <rdar://problem/14845844>
Support inline scopes once we have an optimizing SIL-based inliner

Patch by Adrian Prantl.

Swift SVN r18835
This commit is contained in:
Bob Wilson
2014-06-12 19:48:43 +00:00
parent fe63f7d35c
commit 2df66cf8c4
19 changed files with 252 additions and 77 deletions

View File

@@ -425,6 +425,12 @@ SILFunction *SILDeserializer::readSILFunction(DeclID FID,
fn->setBare(IsBare);
if (!fn->hasLocation()) fn->setLocation(loc);
DebugScope = fn->getDebugScope();
if (!DebugScope) {
DebugScope = new (SILMod) SILDebugScope(loc, *fn);
fn->setDebugScope(DebugScope);
}
GenericParamList *contextParams = nullptr;
if (!declarationOnly) {
// We need to construct a linked list of GenericParamList. The outermost
@@ -623,7 +629,8 @@ bool SILDeserializer::readSILInstruction(SILFunction *Fn, SILBasicBlock *BB,
if (!BB)
return true;
SILBuilder Builder(BB);
SmallVector<SILInstruction*, 1> InsertedInsn;
SILBuilder Builder(BB, &InsertedInsn);
unsigned OpCode = 0, TyCategory = 0, TyCategory2 = 0, ValResNum = 0,
ValResNum2 = 0, Attr = 0,
IsTransparent = 0, NumSubs = 0;
@@ -1510,6 +1517,10 @@ bool SILDeserializer::readSILInstruction(SILFunction *Fn, SILBasicBlock *BB,
}
if (ResultVal->hasValue())
setLocalValue(ResultVal, ++LastValueID);
for (auto I : InsertedInsn)
I->setDebugScope(DebugScope);
return false;
}