================
@@ -1310,21 +1310,91 @@ static llvm::Value 
*CoerceIntOrPtrToIntOrPtr(llvm::Value *Val, llvm::Type *Ty,
   return Val;
 }
 
+static std::vector<PFPField> findPFPCoercedFields(CodeGenFunction &CGF,
+                                                  QualType SrcFETy) {
+  // Coercion directly through memory does not work if the structure has 
pointer
+  // field protection because the struct in registers has a different bit
+  // pattern to the struct in memory, so we must read the elements one by one
+  // and use them to form the coerced structure.
+  std::vector<PFPField> PFPFields;
+  CGF.getContext().findPFPFields(SrcFETy, CharUnits::Zero(), PFPFields, true);
----------------
fmayer wrote:

`/*IsWithinUnion=*/true`

And I am confused, or `isWithinUnion` is true for all of the return objects? 
AFAIK in `findPFPFields` `IsWithinUnion` can only be changed to true (through 
the `|=`), and never to false. And all the recursive calls either use 
`isWithinUnion` or `true`.

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

Reply via email to