mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-23 20:16:06 +00:00

category is empty Currently, if we create a category in ObjC that is empty, we still emit runtime metadata for that category. This is a scenario that could commonly be run into when using __attribute__((objc_direct_members)), which elides the need for much of the category metadata. This is slightly wasteful and can be easily skipped by checking the category metadata contents during CodeGen. rdar://66177182 Differential Revision: https://reviews.llvm.org/D113455
17 lines
398 B
Objective-C
17 lines
398 B
Objective-C
// RUN: %clang_cc1 -triple i386-apple-darwin9 -O0 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s
|
|
// PR7431
|
|
|
|
// CHECK-NOT: @"OBJC_LABEL_CATEGORY_$" = private global [1 x i8*] [i8* bitcast (%struct._category_t* @"_OBJC_$_CATEGORY_A_$_foo"
|
|
|
|
@interface A
|
|
@end
|
|
__attribute__((objc_direct_members))
|
|
@interface A(foo)
|
|
- (void)foo_myStuff;
|
|
@end
|
|
@implementation A(foo)
|
|
- (void)foo_myStuff {
|
|
}
|
|
@end
|
|
|