summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index f650e046c0d..9228d65250c 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -15465,8 +15465,13 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl,
Record->setNonTrivialToPrimitiveDestroy(true);
Record->setParamDestroyedInCallee(true);
}
- if (!FT.canPassInRegisters())
- Record->setCanPassInRegisters(false);
+
+ if (const auto *RT = FT->getAs<RecordType>()) {
+ if (RT->getDecl()->getArgPassingRestrictions() ==
+ RecordDecl::APK_CanNeverPassInRegs)
+ Record->setArgPassingRestrictions(RecordDecl::APK_CanNeverPassInRegs);
+ } else if (FT.getQualifiers().getObjCLifetime() == Qualifiers::OCL_Weak)
+ Record->setArgPassingRestrictions(RecordDecl::APK_CanNeverPassInRegs);
}
if (Record && FD->getType().isVolatileQualified())
OpenPOWER on IntegriCloud