[PATCH] D156027: [clang][Interp] Rework how initializers work

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 2 06:35:06 PDT 2023


aaron.ballman added inline comments.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:545-547
+      // TODO(perf): For int and bool types, we can probably just skip this
+      //   since we memset our Block*s to 0 and so we have the desired value
+      //   without this.
----------------
We might be able to get away with this for floats as well (IIRC, all zero bits is +0 for any IEEE 754 float type, so at least some of the more common floats could probably do this). Same is true for any pointer type so long as it's not a member pointer type.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1515-1519
+  if (std::optional<PrimType> T = classify(E->getType())) {
+    return visit(E);
+  } else {
+    return this->bail(E);
+  }
----------------



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

https://reviews.llvm.org/D156027



More information about the cfe-commits mailing list