[PATCH] D141472: [clang][Interp] Add function pointers

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 31 00:10:43 PST 2023


tbaeder added a comment.

In D141472#4091662 <https://reviews.llvm.org/D141472#4091662>, @aaron.ballman wrote:

> Design question -- do you anticipate this class handling *all* function pointers, including pointer to member functions that might be virtual: https://godbolt.org/z/hT8fMY37n

I had to make a few adjustments but I have that example working locally now, of course no idea if that would work generally. Do you see any problem with the proposed `FunctionPointer` class?

According to https://clang.llvm.org/docs/ConstantInterpreter.html#pointers, there was a `MemberPointer` class that sounds related to this, but I don't know more about it. I guess, since you made `func()` virtual, that matters and becomes a bytecode-runtime decision instead of being known at compile-time, which seems to be the case in your example?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141472/new/

https://reviews.llvm.org/D141472



More information about the cfe-commits mailing list