[PATCH] D155270: [clang][Interp] Basic support for bit fields

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 1 08:06:20 PDT 2023


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

In D155270#4550473 <https://reviews.llvm.org/D155270#4550473>, @tbaeder wrote:

> In D155270#4550466 <https://reviews.llvm.org/D155270#4550466>, @aaron.ballman wrote:
>
>> Precommit CI is currently crashing on the newly introduced test case.
>
> It's missing https://reviews.llvm.org/D155548 :)
>
> That's of course just a workaround. At the beginning of the `evalute*` fuctions in the new interpreter, there's a `assert(S.Stk.empty())`, to ensure that a previous interpret call didn't leave someting on the stack. But that doesn't work anymore since `FieldDecl::getBitWidthValue()` calls in the interpreter again while we're already evaluating something, so that assertion triggers.

Ah, I see, thank you for the explanation!

There's more work left here for supporting other operators and uses, but as far as these changes go, they seem reasonable to me. It'd be good to add Shafik's suggested test cases even if they're surrounded with FIXME comments, just so we don't lose track of the request.


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

https://reviews.llvm.org/D155270



More information about the cfe-commits mailing list