]> granicus.if.org Git - clang/commit
Convert some ObjC msgSends to runtime calls.
authorPete Cooper <peter_cooper@apple.com>
Wed, 16 Mar 2016 00:33:21 +0000 (00:33 +0000)
committerPete Cooper <peter_cooper@apple.com>
Wed, 16 Mar 2016 00:33:21 +0000 (00:33 +0000)
commit65556141a6f06dba23767c73025123e74427048a
tree01166be00488933cdd2387c549ee7e939fd4fdd8
parent90b80810bd22e2bc1916e72660fd99b07868bf06
Convert some ObjC msgSends to runtime calls.

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.

Reviewed by John McCall.

Differential Revision: http://reviews.llvm.org/D14737

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263607 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/ObjCRuntime.h
include/clang/Driver/Options.td
include/clang/Frontend/CodeGenOptions.def
lib/CodeGen/CGObjC.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 [new file with mode: 0644]
test/Driver/objc-convert-messages-to-runtime-calls.m [new file with mode: 0644]