[PATCH] D113455: [clang][objc][codegen] Skip emitting ObjC category metadata when the category is empty

Zoe Carver via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 11 14:12:10 PST 2021


zoecarver accepted this revision.
zoecarver added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/CodeGen/CGObjCMac.cpp:6683
+  values.add(classMethodList);
+  isEmptyCategory &=
+      instanceMethodList->isNullValue() && classMethodList->isNullValue();
----------------
Does this really need to be an `&=`? Is there any case where `isEmptyCategory` isn't `true` here?


================
Comment at: clang/test/CodeGenObjC/category-class-empty.m:1
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -O3 -emit-llvm -o - %s | FileCheck %s
+// PR7431
----------------
Is `-O3` needed here?


================
Comment at: clang/test/CodeGenObjC/non-lazy-classes.m:45
 __attribute__((objc_nonlazy_class))
- at implementation E (MyCat) @end
+ at implementation E (MyCat)
+-(void) load {
----------------
This is to prevent another test from failing? Makes sense. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113455/new/

https://reviews.llvm.org/D113455



More information about the cfe-commits mailing list