to support brace entry/exit. We now maintain a
stack of brace statements we know we're inside.
The elements of this stack are colored:
- If we encounter a loop, while we are walking
that loop we color its container to indicate
that "break" and "continue" exit all braces
up until the container of the loop.
- If we encounter a function, while we are
walking that function we color its container
to indicate that "return" exits all braces
up until the container of the function.
Since at this point every BraceStmt is modified,
we don't need the "Modified" flag and I excised
it.
Swift SVN r16230
entries and exits.
- Added support to buildLoggerCall for different
logger functions;
- Added support to buildLoggerCall to handle
source locations that fall outside the
user-entered expression text; and
- Added the necessary logging functions to the
functions we check for before adding our
instrumentation.
This involved some minor refactoring. I still have
to add a stack of scopes that I can pop out of when
I see a break, continue, or return.
Swift SVN r16197
caused direct logging of expression to fail type
check sometimes. We introduce an intermediate
variable, so instead of (pseudocode)
3 -> log(3)
we have
3 -> var tmp = 3; log(tmp)
Swift SVN r16189
- Fixed a bug where it did not instrument a "for-in" loop.
- Made sure nested function declarations' bodies are
instrumented.
- Added instrumentation for return statements.
<rdar://problem/16516131>
Swift SVN r15960
- Don't be so sensitive about how many of the
required functions there are; and
- Don't include the "header" parameter to
playground_log any more; it's not needed.
Swift SVN r15755
loop constructs and mutations of variables.
We also try to ignore expressions that return
empty tuples, because this causes type-checking
failures.
Swift SVN r15568
- use the most recent prototype for the logger
function (playground_log), and
- send the output of the logger function to
DVTSendPlaygroundLogDataToHost.
Swift SVN r14892
"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