[clang] [clang][Interp] Merge ByteCodeExprGen and ByteCodeStmtGen (PR #83683)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 4 10:18:26 PST 2024


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/83683 at github.com>


AaronBallman wrote:

> But that's not the problem I have in mind. My problem is the other way around: when `ByteCodeExprGen` needs to generate code for statements. It has no `visitStmt` function, because that's only implemented in the subclass.

Ah, so the choices boil down to using a single interface like this, or doing something like CRTP (or virtual dispatch)?

I like the separation of concerns between the stmt and expr emitters, but I'm not opposed to unifying them. How ugly does CRTP get though?

https://github.com/llvm/llvm-project/pull/83683


More information about the cfe-commits mailing list