]> granicus.if.org Git - clang/commit
[OBJC] Add attribute to mark Objective C class as non-lazy
authorJoe Daniels <joseph_daniels@apple.com>
Mon, 4 Feb 2019 23:32:55 +0000 (23:32 +0000)
committerJoe Daniels <joseph_daniels@apple.com>
Mon, 4 Feb 2019 23:32:55 +0000 (23:32 +0000)
commit66dd171c9485c7763044e211f5f1aeeb7f48e749
tree71824c01498b17305fb51db557f7c6f0576c4a89
parent24cae3f9a09510fe5c6937d74d83c418e4c01365
[OBJC] Add attribute to mark Objective C class as non-lazy

A non-lazy class will be initialized eagerly when the Objective-C runtime is
loaded. This is required for certain system classes which have instances allocated in
non-standard ways, such as the classes for blocks and constant strings.
Adding this attribute is essentially equivalent to providing a trivial
+load method but avoids the (fairly small) load-time overheads associated
with defining and calling such a method.

Differential Revision: https://reviews.llvm.org/D56555

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353116 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
lib/CodeGen/CGObjCMac.cpp
lib/Sema/SemaDeclAttr.cpp
test/CodeGenObjC/non-lazy-classes.m
test/Misc/pragma-attribute-supported-attributes-list.test
test/SemaObjC/attr-objc-non-lazy.m [new file with mode: 0644]