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:
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
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
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
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
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
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
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
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
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
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:
11 matches
Mail list logo