Testcase for the playground transform.

This is the first testcase and includes the test
harness which will work for other testcases as
well.

Also includes a fix to make sure that we only
instrument once per main source file, and not
once per parse as we were doing before.


Swift SVN r20456
This commit is contained in:
Sean Callanan
2014-07-24 01:31:56 +00:00
parent b6818046a8
commit 155253124e
3 changed files with 65 additions and 6 deletions

View File

@@ -412,16 +412,15 @@ void CompilerInstance::performSema() {
parseIntoSourceFile(MainFile, MainFile.getBufferID().getValue(), &Done,
TheSILModule ? &SILContext : nullptr,
&PersistentState, DelayedCB.get());
if (PrimaryBufferID == NO_SUCH_BUFFER ||
MainBufferID == PrimaryBufferID) {
if (PrimaryBufferID == NO_SUCH_BUFFER || MainBufferID == PrimaryBufferID)
performTypeChecking(MainFile, PersistentState.getTopLevelContext(),
CurTUElem);
if (Invocation.getFrontendOptions().Playground)
performPlaygroundTransform(MainFile);
}
CurTUElem = MainFile.Decls.size();
} while (!Done);
if (Invocation.getFrontendOptions().Playground &&
(PrimaryBufferID == NO_SUCH_BUFFER || MainBufferID == PrimaryBufferID))
performPlaygroundTransform(MainFile);
}
// Type-check each top-level input besides the main source file.