]> granicus.if.org Git - clang/commit
Convert some ObjC msgSends to runtime calls.
authorPete Cooper <peter_cooper@apple.com>
Sat, 8 Dec 2018 05:13:50 +0000 (05:13 +0000)
committerPete Cooper <peter_cooper@apple.com>
Sat, 8 Dec 2018 05:13:50 +0000 (05:13 +0000)
commitbfa6f5fe991a922e28ed05263ed795b8fb058b4b
treefcb3cf8a3e1c42ac641a43119e26834a79b20237
parent322b88de1fc968656cbb16103049a5c573e0deb8
Convert some ObjC msgSends to runtime calls.

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

This patch adds support for converting messages to alloc/allocWithZone 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: rjmccall

https://reviews.llvm.org/D55349

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348687 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/ToolChains/Clang.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]