summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/InMemoryModuleCache.cpp
diff options
context:
space:
mode:
authorPierre Habouzit <phabouzit@apple.com>2019-12-19 01:25:03 -0800
committerPierre Habouzit <phabouzit@apple.com>2019-12-20 10:57:36 -0800
commit42f9d0c0bee32a1a48a45c039988d27115f30da9 (patch)
tree8d8a73f5881c17508d40ef6c06aed01feede1092 /clang/lib/Serialization/InMemoryModuleCache.cpp
parent810c3cfa664b38b27bc30afaadab3d775cb17922 (diff)
downloadbcm5719-llvm-42f9d0c0bee32a1a48a45c039988d27115f30da9.tar.gz
bcm5719-llvm-42f9d0c0bee32a1a48a45c039988d27115f30da9.zip
[objc_direct] Tigthen checks for direct methods
Because the name of a direct method must be agreed upon by the caller and the implementation, certain bad practices that one can get away with when using dynamism are fatal with direct methods. To avoid really weird and unscruttable linker error, tighten the front-end error reporting. Rule 1: Direct methods can only have at most one declaration in an @interface container. Any redeclaration is strictly forbidden. Today some amount of redeclaration is tolerated between the main interface and categories for dynamic methods, but we can't have that. Rule 2: Direct method implementations can only be declared in a matching @interface container: when implemented in the primary @implementation then the declaration must be in the primary @interface or an extension, and when implemented in a category, the declaration must be in the @interface for the same category. Also fix another issue with ObjCMethod::getCanonicalDecl(): when an implementation lives in the primary @interface, then its canonical declaration can be in any extension, even when it's not an accessor. Add Sema tests to cover the new errors, and CG tests to beef up testing around function names for categories and extensions. Radar-Id: <rdar://problem/58054563> Differential Revision: https://reviews.llvm.org/D71694
Diffstat (limited to 'clang/lib/Serialization/InMemoryModuleCache.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud