Skip to content
Unverified Commit dea5a9cc authored by Jun Zhang's avatar Jun Zhang
Browse files

[clang-repl] Implement code undo.



In interactive C++ it is convenient to roll back to a previous state of the
compiler. For example:
clang-repl> int x = 42;
clang-repl> %undo
clang-repl> float x = 24 // not an error

To support this, the patch extends the functionality used to recover from
errors and adds functionality to recover the low-level execution infrastructure.

The current implementation is based on watermarks. It exploits the fact that
at each incremental input the underlying compiler infrastructure is in a valid
state. We can only go N incremental inputs back to a previous valid state. We do
not need and do not do any further dependency tracking.

This patch was co-developed with V. Vassilev, relies on the past work of Purva
Chaudhari in clang-repl and is inspired by the past work on the same feature
in the Cling interpreter.

Co-authored-by: default avatarPurva-Chaudhari <purva.chaudhari02@gmail.com>
Co-authored-by: default avatarVassil Vassilev <v.g.vassilev@gmail.com>
Signed-off-by: default avatarJun Zhang <jun@junz.org>
parent 9de8b05b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment