[PATCH] D137240: [clang][Interp] Support alignof()

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 7 08:26:25 PST 2022


aaron.ballman accepted this revision.
aaron.ballman added a comment.

In D137240#3909034 <https://reviews.llvm.org/D137240#3909034>, @tbaeder wrote:

> It's not really all that interesting since the current interpreter already does all the work, but it works like this.

Ahhh okay, that makes sense, thanks!



================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:461
+    return this->emitConst(Size.getQuantity(), E);
+  } else if (Kind == UETT_AlignOf || Kind == UETT_PreferredAlignOf) {
+    CharUnits Size;
----------------
No need for the `else` because of the unconditional return in the `if` branch.


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

https://reviews.llvm.org/D137240



More information about the cfe-commits mailing list