[PATCH] D148426: [clang][Interp] IntegralComplexToBoolean casts

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 15 05:25:36 PDT 2023


tbaeder added inline comments.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1165
+    return visit(LV);
+
   return false;
----------------
Since complex types are arrays with two elements, we can't dereference them like normal. This change just ignore the dereference.

I was wondering if it would be better to add an opcode to dereference it so we have `[real, imag]` on the stack and then callers that operate on such complex rvalues can `pop(); pop();` to get the values.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148426



More information about the cfe-commits mailing list