This is an archive of the discontinued LLVM Phabricator instance.

Add ObjC category merging to ObjCPass
Needs ReviewPublic

Authored by pete on Feb 1 2016, 4:54 PM.

Details

Reviewers
lhames
Summary

This ports the start of the ObjC category merging pass from ld64 to lld.

This is used in code such as the following:

@interface A @end
@implementation A
+(void) foo {
}
@end

@interface A (Cat) @end
@implementation A (Cat)
+(void) bar {
}
@end

In this example, we would have a category list with the element 'A (Cat)'. This pass takes the methods from the category and adds them to the method list on the class 'A'. That is, class 'A' had a method list { foo } but after this pass will have { foo, bar }.

This is only the first of several optimizations in this area. This handles instance methods, but future commits will handle class methods, protocols, and properties. The code here is meant to be extensible in that i'll later need to add support for all the different offsets and atom types for those optimizations too.

Diff Detail

Event Timeline

pete updated this revision to Diff 46594.Feb 1 2016, 4:54 PM
pete retitled this revision from to Add ObjC category merging to ObjCPass.
pete updated this object.
pete added a reviewer: lhames.
pete added a project: lld.
pete added subscribers: kledzik, llvm-commits.