================
@@ -17724,7 +17078,24 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr 
*E) {
   case CK_HLSLAggregateSplatCast:
     llvm_unreachable("invalid cast kind for integral value");
 
-  case CK_BitCast:
+  case CK_BitCast:{
+  APValue Sub;
+  if (!Evaluate(Sub, Info, E->getSubExpr()))
+    return false;
+
+  QualType SrcTy = E->getSubExpr()->getType();
+  QualType DstTy = E->getType();
+
+  // Allow reinterpretation if bit widths match
+  if (Info.Ctx.getTypeSize(SrcTy) == Info.Ctx.getTypeSize(DstTy)) {
+    // Use APValue::BitCast if available, else just copy value bits
----------------
tbaederr wrote:

What is `APValue::BitCast`?

https://github.com/llvm/llvm-project/pull/167016
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to