[clang-repl] Extend the C support. (#89804)
commit253c28fa829cee0104c2fc59ed1a958980b5138c
authorVassil Vassilev <v.g.vassilev@gmail.com>
Tue, 21 May 2024 17:21:32 +0000 (21 20:21 +0300)
committerGitHub <noreply@github.com>
Tue, 21 May 2024 17:21:32 +0000 (21 20:21 +0300)
tree8c541029dd0542e925c614e42ffd541a6329120d
parent98f105a1304e8d3fd0a0234d1d488ed513833df8
[clang-repl] Extend the C support. (#89804)

The IdResolver chain is the main way for C to implement lookup rules.
Every new partial translation unit caused clang to exit the top-most
scope which in turn cleaned up the IdResolver chain. That was not an
issue for C++ because its lookup is implemented on the level of
declaration contexts.

This patch keeps the IdResolver chain across partial translation units
maintaining proper C-style lookup infrastructure.
clang/lib/Interpreter/IncrementalParser.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/Interpreter/execute.c [new file with mode: 0644]