[all-commits] [llvm/llvm-project] 45ffe6: [clang/objc] Optimize getters for non-atomic, copi...

Nico Weber via All-commits all-commits at lists.llvm.org
Tue Jul 13 06:37:15 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 45ffe6341d9642487785b0d0028166e6fbdbe5d7
      https://github.com/llvm/llvm-project/commit/45ffe6341d9642487785b0d0028166e6fbdbe5d7
  Author: Dave MacLachlan <dmaclach at google.com>
  Date:   2021-07-13 (Tue, 13 Jul 2021)

  Changed paths:
    M clang/lib/CodeGen/CGObjC.cpp
    M clang/test/CodeGenObjC/arc-blocks.m

  Log Message:
  -----------
  [clang/objc] Optimize getters for non-atomic, copied properties

Properties that were declared `@property(copy, nonatomic) id foo` make an
unnecessary call to objc_get_property().  This call can be replaced with a
direct access to the backing variable identical to how a `@property(nonatomic)
id foo` would do it.

This reduces codegen by 4 bytes (x86_64/arm64) and removes a cross linkage unit
function call per property declared as copy/nonatomic.

Differential Revision: https://reviews.llvm.org/D105311




More information about the All-commits mailing list