[clang][Interp] Add ArrayElemPtr{,Pop} opcode
authorTimm Bäder <tbaeder@redhat.com>
Sat, 31 Dec 2022 16:06:52 +0000 (17:06 +0100)
committerTimm Bäder <tbaeder@redhat.com>
Thu, 2 Mar 2023 08:45:18 +0000 (09:45 +0100)
commit6b5afda61c4ad6890e62cb8572a13a538316d31c
tree5efd2a7eedc6b05f5906d9f81f473ed052e3438e
parente0bc7790005a5da36d954fee6b20b441dec929d8
[clang][Interp] Add ArrayElemPtr{,Pop} opcode

We usually access array elements in the same pattern, which uses
narrow(). Add an extra opcode for this. This saves us quite some
instructions and makes the bytecode easier to read.

Differential Revision: https://reviews.llvm.org/D140805
clang/lib/AST/Interp/ByteCodeExprGen.cpp
clang/lib/AST/Interp/Interp.h
clang/lib/AST/Interp/Opcodes.td