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

2016-10-18 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. ahatanak marked 2 inline comments as done. Closed by commit rL284516: [CodeGen][ObjC] Do not call objc_storeStrong when initializing a (authored by ahatanak). Changed prior to commit:

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

2016-10-18 Thread John McCall via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Thanks, that looks great! LGTM. https://reviews.llvm.org/D25547 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2016-10-17 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 74944. ahatanak added a comment. Address review comments. Simplify and add comments. https://reviews.llvm.org/D25547 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CGObjC.cpp lib/CodeGen/CGStmtOpenMP.cpp

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

2016-10-17 Thread John McCall via cfe-commits
rjmccall added a comment. Thanks! A couple minor tweaks, then LGTM. Comment at: lib/CodeGen/CGExpr.cpp:1652 +Src = RValue::get(EmitObjCExtendObjectLifetime(Dst.getType(), + Src.getScalarVal())); // fall into

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

2016-10-17 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 74851. ahatanak added a comment. Simplify the code a bit more. https://reviews.llvm.org/D25547 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CGObjC.cpp lib/CodeGen/CGStmtOpenMP.cpp lib/CodeGen/CodeGenFunction.h

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

2016-10-14 Thread John McCall via cfe-commits
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

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

2016-10-14 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 74760. ahatanak added a comment. Fold EmitScalarInit into EmitStoreThroughLValue and remove EmitScalarInit. I don't think ElementType in EmitObjCCollectionLiteral has a lifetime qualifier, so it should be safe to call EmitStoreThroughLValue instead of

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

2016-10-14 Thread John McCall via cfe-commits
rjmccall added a comment. Sorry, no, just the one that takes an llvm::Value* instead of an Expr*. https://reviews.llvm.org/D25547 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2016-10-14 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. There are two overloaded functions of CodeGenFunction::EmitScalarInit. Are you suggesting we fold both of them into EmitStoreThroughLValue and remove them? https://reviews.llvm.org/D25547 ___ cfe-commits mailing list

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

2016-10-13 Thread John McCall via cfe-commits
rjmccall added a comment. The correct fix is to honor isInit by folding the logic for EmitScalarInit into this function. That should allow you to eliminate EmitScalarInit completely, although it would be fine to leave it as just a call to EmitStoreThroughLValue. I did a quick audit of all

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

2016-10-12 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: rjmccall. ahatanak added a subscriber: cfe-commits. When compiling a constexpr NSString initialized with an objective-c string literal, CodeGen currently emits objc_storeStrong on an uninitialized alloca, which causes a crash: