================
@@ -905,6 +906,29 @@ bool ConstStructBuilder::Build(const APValue &Val, const 
RecordDecl *RD,
     if (!EltInit)
       return false;
 
+    if (CGM.getContext().isPFPField(*Field)) {
+      llvm::ConstantInt *Disc;
+      llvm::Constant *AddrDisc;
+      if (CGM.getContext().arePFPFieldsTriviallyCopyable(RD)) {
+        uint64_t FieldSignature =
+            llvm::getPointerAuthStableSipHash(CGM.getPFPFieldName(*Field));
+        Disc = llvm::ConstantInt::get(CGM.Int64Ty, FieldSignature);
+        AddrDisc = llvm::ConstantPointerNull::get(CGM.VoidPtrTy);
+      } else if (Emitter.isAbstract()) {
----------------
pcc wrote:

`isAbstract` means that we don't know the global's address. Since we can only 
form a pointer without knowing the address if the fields are trivially 
copyable, I think this is the right place for the condition.

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

Reply via email to