This is the second part of the below RFC:
This patch implements a Value class that can be used to carry expression
results in clang-repl. In other words, when we see a top expression
without semi, it will be captured and stored to a Value object. You can
explicitly specify where you want to store the object, like:
Value V; llvm::cantFail(Interp->ParseAndExecute("int x = 42;")); llvm::cantFail(Interp->ParseAndExecute("x", &V));
V now stores some useful infomation about x, you can get its real
value (42), it's clang::QualType or anything interesting.
However, if you don't specify the optional argument, it will be captured
to a local variable, and automatically called Value::dump, which is
not implemented yet in this patch.
Signed-off-by: Jun Zhang <firstname.lastname@example.org>