mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Frontend] Add option and test for the "-playground without the transform" mode.
Swift SVN r22916
This commit is contained in:
@@ -162,7 +162,10 @@ def print_stats : Flag<["-"], "print-stats">,
|
|||||||
HelpText<"Print various statistics">;
|
HelpText<"Print various statistics">;
|
||||||
|
|
||||||
def playground : Flag<["-"], "playground">,
|
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">,
|
def use_jit : Flag<["-"], "use-jit">,
|
||||||
HelpText<"Register Objective-C classes as if the JIT were in use">;
|
HelpText<"Register Objective-C classes as if the JIT were in use">;
|
||||||
|
|||||||
@@ -150,6 +150,8 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
|
|||||||
Opts.PrintClangStats |= Args.hasArg(OPT_print_clang_stats);
|
Opts.PrintClangStats |= Args.hasArg(OPT_print_clang_stats);
|
||||||
|
|
||||||
Opts.PlaygroundTransform |= Args.hasArg(OPT_playground);
|
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 (const Arg *A = Args.getLastArg(OPT_help, OPT_help_hidden)) {
|
||||||
if (A->getOption().matches(OPT_help)) {
|
if (A->getOption().matches(OPT_help)) {
|
||||||
|
|||||||
9
test/PlaygroundTransform/disable_transform_only.swift
Normal file
9
test/PlaygroundTransform/disable_transform_only.swift
Normal 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
|
||||||
Reference in New Issue
Block a user