================
@@ -16276,13 +16276,44 @@ static bool determineEndOffset(EvalInfo &Info, 
SourceLocation ExprLoc,
   return true;
 }
 
+/// Determine whether @p E designates a flexible array member annotated with
+/// 'counted_by'. This mirrors the Expr-walking that CGBuiltin's
+/// StructFieldAccess / emitCountedByMemberSize do to decide whether to emit
----------------
kees wrote:

Hm, on further investigation, I needed to match GCC's behavior here. I need to 
deliberately treat '&af.fam' (address-of-array) as *not* a `counted_by` access 
since '&af.fam' designates the array object as a whole and gets the 
layout-derived size, while 'af.fam' (decayed) and '&af.fam[idx]' designate 
element-pointers and get the count-based size.

I will move the visitor code out to get shared; I wasn't sure how to do that, 
but I think putting it in Expr.cpp/h works?


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

Reply via email to