[cfe-commits] [PATCH] Add -fobjc-direct-class-refs

Jonathan Schleifer js at webkeks.org
Mon May 14 11:44:12 PDT 2012

Am 14.05.2012 um 20:34 schrieb John McCall:

> If the GNU runtime supports emitting direct references to the class, why is a command-line option necessary?

The GNU runtime does not. The GNUstep runtime does and mine does.

It needs to be an option as this is not even part of the new, non-fragile ABI. So when compiling against the GNUstep or my runtime, this flag can be used to directly reference classes - this makes for more than a 2x speedup in real world application. This also means this is independent on whether you use the fragile or non-fragile ABI. You might want to use the fragile ABI with -fobjc-direct-class-refs for maximum performance.

> I am opposed to providing an ever-expanding spectrum of command line flags — particularly driver flags! — to slightly tweak the ABI.

Then we need a module for each runtime so we have multiple -f*-runtime. CGObjCGNU.cpp would need to be splitted into CGObjCGNU.cpp, CGObjCGNUstep.cpp and CGObjCObjFW.cpp for -fgnu-runtime, -fgnustep-runtime and -fobjfw-runtime - for just a few lines of differences. Is this really better?

> Even if we supported this, it would be an IR-gen option, not a language option.

Can you elaborate, please? I'm new to Clang's code.

I'd really like to get this patch or a similar patch providing the same functionality upstream. The performance without it is really slow and I don't want to tell all users to apply the patch manually and rebuild clang to get acceptable performance. It would be much more desirable if it would just be incorporated upstream.

PS: I'm still not subscribed to the list - please CC me.


More information about the cfe-commits mailing list