[clang][Interp] Unify visiting variable declarations
authorTimm Bäder <tbaeder@redhat.com>
Thu, 27 Oct 2022 04:16:01 +0000 (06:16 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Thu, 19 Jan 2023 09:46:16 +0000 (10:46 +0100)
commit5b54cf1a2892767fe949826a32d7820732028a38
tree8380800ecff9b011785519205eb4857499bc8e20
parent871815e062a9e1d143f29333e6129f1cad0f83bb
[clang][Interp] Unify visiting variable declarations

We often visit the same variable multiple times, e.g. once when checking
its initializer and later when compiling the function. Unify both of
those in visitVarDecl() and do the returning of the value in
visitDecl().

Differential Revision: https://reviews.llvm.org/D136815
clang/lib/AST/Interp/ByteCodeExprGen.cpp
clang/lib/AST/Interp/ByteCodeExprGen.h
clang/lib/AST/Interp/ByteCodeStmtGen.cpp
clang/lib/AST/Interp/ByteCodeStmtGen.h
clang/lib/AST/Interp/Program.cpp
clang/lib/AST/Interp/Program.h