[clang-repl] Support compound statement as a top-level statement.
commit159073bc0a873b9aa2bc559a8ceba970b049cda2
authorVassil Vassilev <v.g.vassilev@gmail.com>
Sun, 11 Dec 2022 21:08:30 +0000 (11 21:08 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Fri, 17 Feb 2023 09:09:04 +0000 (17 09:09 +0000)
tree34c1d36ebf7f491afdbd4f07ab4b6dee6c6d58f8
parenteb2f946e780cc0e82260c775930fa0509885b1ea
[clang-repl] Support compound statement as a top-level statement.

This patch teaches our incremental compilation infrastructure to push and pop a
fake function scope making the Parser happy when parsing compound statements as
part of a top-leve statement declaration.

Differential revision: https://reviews.llvm.org/D139798
clang/lib/Parse/ParseDecl.cpp
clang/test/Interpreter/execute-stmts.cpp