[PATCH] D55349: Convert some ObjC alloc msgSends to runtime calls

Pete Cooper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 5 18:07:14 PST 2018


pete created this revision.
pete added reviewers: ahatanak, rjmccall, erik.pilkington.
Herald added a subscriber: cfe-commits.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D55349

Files:
  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
  test/Driver/objc-convert-messages-to-runtime-calls.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55349.176912.patch
Type: text/x-patch
Size: 18595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181206/f8430028/attachment-0001.bin>


More information about the cfe-commits mailing list