mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Added a new AST transformation pass called the
"Playground Transform." This is an instrumentation pass that adds calls to a function called playground_log at locations of interest. Roughly speaking, these locations are - Initialization of variables - Modification of variables - Expressions returning values - Application of mutating methods on objects The playground transform currently only finds modifications of variables, but the intent is to make all of these cases work. It is enabled by a frontend option, and can also be invoked by calling swift::performPlaygroundTransform(SF) which is the way LLDB, its main client, will use it. The frontend option is intended for testing, and indeed I will add tests for this transformation in the coming week as I bring more functionality online. Swift SVN r14801
This commit is contained in:
@@ -96,6 +96,10 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
|
||||
Opts.PrintStats = true;
|
||||
}
|
||||
|
||||
if (Args.hasArg(OPT_playground)) {
|
||||
Opts.Playground = true;
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_help, OPT_help_hidden)) {
|
||||
if (A->getOption().matches(OPT_help)) {
|
||||
Opts.PrintHelp = true;
|
||||
|
||||
Reference in New Issue
Block a user