[clang-repl] Recover the lookup tables of the primary context.
authorPurva-Chaudhari <purva.chaudhari02@gmail.com>
Sun, 29 May 2022 04:55:10 +0000 (04:55 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Sun, 29 May 2022 04:59:40 +0000 (04:59 +0000)
commit5ff27fe1ff03d5aeaf8567c97618170f0cef8f58
treeacfba374f1052dd8961d83cb669bd33edd814b0d
parent41a054ef78856b789acfafca92eb8f79b8129ac0
[clang-repl] Recover the lookup tables of the primary context.

Before this patch, there was re-declaration error if error was encountered in
the same line. The recovery support acted only if this type of error was
encountered in the first line of the program and not in subsequent lines.

For example:

```
clang-repl> int i=9;
clang-repl> int j=9; err;
input_line_3:1:5: error: redefinition of 'j'
int j = 9;
```

Differential revision: https://reviews.llvm.org/D123674
clang/lib/Interpreter/IncrementalParser.cpp
clang/test/Interpreter/execute.cpp