Skip to content

Commit 76a68c1

Browse files
committed
Remove special case for forwarding lambda
Created using spr 1.3.6-beta.1
2 parents ccf26e0 + e3a705a commit 76a68c1

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

clang/lib/CodeGen/CGClass.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,15 +2994,7 @@ void CodeGenFunction::EmitForwardingCallToLambda(
29942994
QualType resultType = FPT->getReturnType();
29952995
ReturnValueSlot returnSlot;
29962996
if (!resultType->isVoidType() &&
2997-
(calleeFnInfo->getReturnInfo().getKind() == ABIArgInfo::Indirect ||
2998-
// With pointer field protection, we need to set up the return slot when
2999-
// returning an object with trivial ABI to avoid the memcpy that would
3000-
// otherwise be generated by the call to EmitReturnOfRValue() below, as
3001-
// that may corrupt the pointer signature. It doesn't hurt to do this all
3002-
// the time as it results in slightly simpler codegen.
3003-
(resultType->isRecordType() &&
3004-
resultType->getAsCXXRecordDecl()
3005-
->hasTrivialCopyConstructorForCall())) &&
2997+
calleeFnInfo->getReturnInfo().getKind() == ABIArgInfo::Indirect &&
30062998
!hasScalarEvaluationKind(calleeFnInfo->getReturnType()))
30072999
returnSlot =
30083000
ReturnValueSlot(ReturnValue, resultType.isVolatileQualified(),

clang/test/CodeGenCXX/trivial_abi.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,11 @@ static_assert(sizeof(S) == 8 && sizeof(S2) == 8, "");
283283

284284
// CHECK: define{{.*}} @"_ZN3$_08__invokeEv"()
285285
// CHECK: %[[RETVAL:.*]] = alloca %[[STRUCT_SMALL]], align 8
286+
// CHECK: %[[COERCE:.*]] = alloca %[[STRUCT_SMALL]], align 8
286287
// CHECK: %[[CALL:.*]] = call{{.*}} @"_ZNK3$_0clEv"
287-
// CHECK: %[[RETVALDIVE:.*]] = getelementptr{{.*}} %[[RETVAL]]
288+
// CHECK: %[[COERCEDIVE:.*]] = getelementptr{{.*}} %[[COERCE]]
288289
// CHECK: %[[COERCEVALIP:.*]] = inttoptr{{.*}} %[[CALL]]
290+
// CHECK: call {{.*}}memcpy{{.*}} %[[RETVAL]]{{.*}} %[[COERCE]]
289291
// CHECK: %[[COERCEDIVE1:.*]] = getelementptr{{.*}} %[[RETVAL]]
290292
// CHECK: %[[TMP:.*]] = load{{.*}} %[[COERCEDIVE1]]
291293
// CHECK: %[[COERCEVALPI:.*]] = ptrtoint{{.*}} %[[TMP]]

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ Expected<Value *> BitcodeReader::materializeValue(unsigned StartValID,
16091609
if (!Disc)
16101610
return error("ptrauth disc operand must be ConstantInt");
16111611

1612-
auto *DeactivationSymbol =
1612+
Constant *DeactivationSymbol =
16131613
ConstOps.size() > 4 ? ConstOps[4]
16141614
: ConstantPointerNull::get(cast<PointerType>(
16151615
ConstOps[3]->getType()));

0 commit comments

Comments
 (0)