[PATCH] D25547: [CodeGen][ObjC] Do not emit objc_storeStrong to initialize a constexpr variable

John McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 14 19:12:35 PDT 2016


rjmccall added inline comments.


================
Comment at: lib/CodeGen/CGExpr.cpp:1650
+    }
+
     switch (Lifetime) {
----------------
I think you can fold this a bit more. :)  You have exactly the same switch statement below, and several of the cases are identical; for the others, you can just sink the isInit check into the case.

Note that calling EmitStoreOfScalar and returning has the same behavior as "falling into the normal path".  isObjCWeak() / isObjCStrong() are checking for the GC qualifiers, which are exclusive with ARC lifetime.


https://reviews.llvm.org/D25547





More information about the cfe-commits mailing list