================
@@ -2232,6 +2233,45 @@ static void emitNonZeroVLAInit(CodeGenFunction &CGF,
QualType baseType,
CGF.EmitBlock(contBB);
}
+Address CodeGenFunction::EmitAddressOfPFPField(Address RecordPtr,
+ const PFPField &Field) {
+ return EmitAddressOfPFPField(
+ RecordPtr,
+ Builder.CreateConstInBoundsByteGEP(RecordPtr.withElementType(Int8Ty),
+ Field.offset),
+ Field.field);
+}
+
+Address CodeGenFunction::EmitAddressOfPFPField(Address RecordPtr,
+ Address PtrPtr,
+ const FieldDecl *Field) {
+ llvm::Value *Disc;
+ bool IsPAuthSupported = getContext().getTargetInfo().getTriple().getArch() ==
+ llvm::Triple::aarch64;
+ if (!IsPAuthSupported ||
+ CGM.getContext().arePFPFieldsTriviallyCopyable(Field->getParent())) {
+ uint64_t FieldSignature =
+ llvm::getPointerAuthStableSipHash(CGM.getPFPFieldName(Field));
+ if (!IsPAuthSupported)
+ FieldSignature &= 0xff;
+ Disc = llvm::ConstantInt::get(CGM.Int64Ty, FieldSignature);
+ } else {
----------------
ojhunt wrote:
brace nit
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