[PATCH] D14737: Convert some ObjC msgSends to runtime calls

Pete Cooper via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 16 17:15:16 PST 2015


pete created this revision.
pete added a reviewer: rjmccall.
pete added a subscriber: cfe-commits.

It is faster to directly call the ObjC runtime for methods such as retain/release instead of sending a message to those functions.

This patch adds support for converting messages to retain/release/alloc/autorelease to their equivalent runtime calls.

Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions.

http://reviews.llvm.org/D14737

Files:
  include/clang/Basic/LangOptions.def
  include/clang/Basic/ObjCRuntime.h
  include/clang/Driver/Options.td
  lib/CodeGen/CGObjC.cpp
  lib/CodeGen/CGObjCMac.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/CodeGen/CodeGenModule.h
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/CodeGenObjC/convert-messages-to-runtime-calls.m
  test/Driver/objc-convert-messages-to-runtime-calls.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14737.40365.patch
Type: text/x-patch
Size: 10567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151117/623976f5/attachment.bin>


More information about the cfe-commits mailing list