================
@@ -916,7 +916,7 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, 
unsigned Type,
 
   // Build a load of the counted_by field.
   bool IsSigned = CountedByFD->getType()->isSignedIntegerType();
-  const Expr *CountedByExpr = BuildCountedByFieldExpr(Base, CountedByFD);
+  Expr *CountedByExpr = BuildCountedByFieldExpr(Base, CountedByFD);
----------------
bwendling wrote:

Sure, that would be fine. However, dealing with all of the forms that the 
expression can take is a nightmare that the `::Emit*Expr` all ready deal with. 
I don't think it's as simple as "find the GEP of the FAM and then replace the 
indices with that of the `counted_by` field."

Or perhaps I'm wrong? @AaronBallman You'd know more about it than I would. Are 
the `::Emit*Expr` methods going to generate more than a load and GEP for this?

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

Reply via email to