[Frontend] Add option and test for the "-playground without the transform" mode.

Swift SVN r22916
This commit is contained in:
Argyrios Kyrtzidis
2014-10-24 17:41:17 +00:00
parent 0e55e054b9
commit ec4e5c0543
3 changed files with 15 additions and 1 deletions

View File

@@ -162,7 +162,10 @@ def print_stats : Flag<["-"], "print-stats">,
HelpText<"Print various statistics">;
def playground : Flag<["-"], "playground">,
HelpText<"Apply the playground transformation">;
HelpText<"Apply the playground semantics and transformation">;
def disable_playground_transform : Flag<["-"], "disable-playground-transform">,
HelpText<"Disable playground transformation">;
def use_jit : Flag<["-"], "use-jit">,
HelpText<"Register Objective-C classes as if the JIT were in use">;

View File

@@ -150,6 +150,8 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
Opts.PrintClangStats |= Args.hasArg(OPT_print_clang_stats);
Opts.PlaygroundTransform |= Args.hasArg(OPT_playground);
if (Args.hasArg(OPT_disable_playground_transform))
Opts.PlaygroundTransform = false;
if (const Arg *A = Args.getLastArg(OPT_help, OPT_help_hidden)) {
if (A->getOption().matches(OPT_help)) {

View File

@@ -0,0 +1,9 @@
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: cp %s %t/main.swift
// RUN: %target-build-swift -Xfrontend -playground -Xfrontend -disable-playground-transform -Xfrontend -debugger-support -o %t/main %S/Inputs/PlaygroundsRuntime.swift %t/main.swift
// RUN: %target-run %t/main | FileCheck %s -allow-empty
var a = 2
var b = 3
a + b
// CHECK-NOT: $builtin_log