[libc-commits] [flang] [libcxx] [compiler-rt] [clang] [libc] [llvm] [Clang] Use correct base expression for counted_by field (#73168) (PR #73465)

Aaron Ballman via libc-commits libc-commits at lists.llvm.org
Mon Nov 27 11:22:51 PST 2023


================
@@ -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);
----------------
AaronBallman wrote:

I'm not opposed but it doesn't seem like a useful change to me -- for starters, we shouldn't be generating new AST nodes at codegen time (this will mean consumers of the AST won't ever see this information), but we especially shouldn't need to *mutate* the pointed-to AST nodes from CodeGen.

https://github.com/llvm/llvm-project/pull/73465


More information about the libc-commits mailing list