This patch is the first part of the below RFC:
https://discourse.llvm.org/t/rfc-handle-execution-results-in-clang-repl/68493
It adds an annotation token that will replace the original EOF token
when we are in incremental C++ mode. In addition, when we're
parsing an ExprStmt and there's a missing semicolon after the
expression, we set a marker in the annotation token and continue
parsing.
Eventually, we propagate this info in ParseTopLevelStmtDecl and are able
to mark this Decl as something we want to do value printing. Below is a
example:
clang-repl> int x = 42;
clang-repl> x
x is a TopLevelStmtDecl and without a semicolon, we should set
it's IsSemiMissing bit so we can do something interesting in
ASTConsumer::HandleTopLevelDecl.
The idea of the annotation token is proposed by Richard Smith, thanks!
Signed-off-by: Jun Zhang <jun@junz.org>
We should change the accessors to the new field name accordingly.