================
@@ -7441,6 +7500,28 @@ static bool handleLValueToRValueBitCast(EvalInfo &Info, 
APValue &DestValue,
   return true;
 }
 
+static bool handleLValueToRValueBitCast(EvalInfo &Info, APValue &DestValue,
+                                        APValue &SourceValue,
+                                        const CastExpr *BCE) {
+  assert(CHAR_BIT == 8 && Info.Ctx.getTargetInfo().getCharWidth() == 8 &&
+         "no host or target supports non 8-bit chars");
+  assert(SourceValue.isLValue() &&
+         "LValueToRValueBitcast requires an lvalue operand!");
+
+  if (!checkBitCastConstexprEligibility(&Info, Info.Ctx, BCE))
+    return false;
----------------
zygoloid wrote:

Can we avoid doing this twice (once here and again in 
`handleRValueToRValueBitCast`? It does a recursive walk of the source and 
destination types so isn't all that cheap.

https://github.com/llvm/llvm-project/pull/66894
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to