]> granicus.if.org Git - clang/commit
[ObjC] Allow declaring __weak pointer fields in C structs in ARC.
authorAkira Hatanaka <ahatanaka@apple.com>
Mon, 19 Mar 2018 17:38:40 +0000 (17:38 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Mon, 19 Mar 2018 17:38:40 +0000 (17:38 +0000)
commit9a8c59234554a43272e9b5f5805094f1dab8762f
tree5b4ef9483ca205f0d208baa48d540469a9046e32
parentd4d6e973395b1cfa42763daf1d445fcb7b4baf4b
[ObjC] Allow declaring __weak pointer fields in C structs in ARC.

This patch uses the infrastructure added in r326307 for enabling
non-trivial fields to be declared in C structs to allow __weak fields in
C structs in ARC.

This recommits r327206, which was reverted because it caused
module-enabled builders to fail. I discovered that the
CXXRecordDecl::CanPassInRegisters flag wasn't being set correctly in
some cases after I moved it to RecordDecl.

Thanks to Eric Liu for helping me investigate the bug.

rdar://problem/33599681

https://reviews.llvm.org/D44095

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327870 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
include/clang/AST/Decl.h
include/clang/AST/DeclCXX.h
include/clang/AST/Type.h
lib/AST/ASTImporter.cpp
lib/AST/Decl.cpp
lib/AST/DeclCXX.cpp
lib/AST/Type.cpp
lib/CodeGen/CGBlocks.cpp
lib/CodeGen/CGNonTrivialStruct.cpp
lib/CodeGen/CGObjC.cpp
lib/CodeGen/CodeGenFunction.h
lib/CodeGen/TargetInfo.cpp
lib/Sema/SemaDecl.cpp
lib/Serialization/ASTReaderDecl.cpp
lib/Serialization/ASTWriter.cpp
lib/Serialization/ASTWriterDecl.cpp
test/CodeGenObjC/nontrivial-c-struct-exception.m
test/CodeGenObjC/weak-in-c-struct.m [new file with mode: 0644]
test/Modules/Inputs/module.map
test/Modules/Inputs/template-nontrivial0.h [new file with mode: 0644]
test/Modules/Inputs/template-nontrivial1.h [new file with mode: 0644]
test/Modules/templates.mm