mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user