[all-commits] [llvm/llvm-project] 7611e1: [clang][objc][codegen] Skip emitting ObjC category...

Akira Hatanaka via All-commits all-commits at lists.llvm.org
Fri Nov 12 16:25:16 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7611e16fce9ce36b6bd6dceda691f6bc7e754347
      https://github.com/llvm/llvm-project/commit/7611e16fce9ce36b6bd6dceda691f6bc7e754347
  Author: Josh Learn <joshua_learn at apple.com>
  Date:   2021-11-12 (Fri, 12 Nov 2021)

  Changed paths:
    M clang/lib/CodeGen/CGObjCMac.cpp
    A clang/test/CodeGenObjC/category-class-empty.m
    M clang/test/CodeGenObjC/non-lazy-classes.m

  Log Message:
  -----------
  [clang][objc][codegen] Skip emitting ObjC category metadata when the
category is empty

Currently, if we create a category in ObjC that is empty, we still emit
runtime metadata for that category. This is a scenario that could
commonly be run into when using __attribute__((objc_direct_members)),
which elides the need for much of the category metadata. This is
slightly wasteful and can be easily skipped by checking the category
metadata contents during CodeGen.

rdar://66177182

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




More information about the All-commits mailing list