Mon, Aug 12
Thanks, committed in r368634.
Revert changes I made to llvm that are unrelated to this patch.
Fri, Aug 9
Thu, Aug 8
Wed, Aug 7
Initialize variable Changed with the return value of the call to UpgradeToIntrinsic.
Upgrade clang.arc.use to llvm.objc.clang.arc.use.
Since ARC optimizer needs clang.arc.use to correctly move or remove retain/release pairs (see the comment in TopDownPtrState::HandlePotentialAlterRefCount), I think we should unconditionally upgrade the intrinsic calls instead of removing them even when the bitcode doesn't have the arm64 marker. I'll update the patch to convert clang.arc.use to llvm.objc.clang.arc.use.
Thu, Aug 1
- Emit member access, compound literal, and call expressions as subexpressions of ExprWithCleanups if the expressions are of C struct types that require non-trivial destruction. This fixes the bug in IRGen where it was destructing the function return at the end of the enclosing scope rather than at the end of the full expression (see the changes made in test/CodeGenObjC/arc.m).
- Add compound literal expressions with automatic storage duration to the list of cleanup objects of ExprWithCleanups if the expressions have C struct types requiring non-trivial destruction. This enables IRGen to destruct the compound literals at the end of their enclosing scopes.
Mon, Jul 29
Fri, Jul 26
I think the fix is correct. When the lambda expression for the generic lambda is built, BuildLambdaExpr passes a Capture object in LambdaScopeInfo::Captures to BuildCaptureField to build the closure class field for the capture, so it should be okay to read the type of the field and pass it to LambdaScopeInfo::addCapture when rebuilding the lambda scope info.
Thu, Jul 25
Mark fields that don't have an explicit __strong qualifier as unavailable.
Wed, Jul 24
Check that the attributed type is an ObjC qualified type. Do not diagnose fields that are unavailable.
Jul 12 2019
In Type.h, move method declarations down and mention that the predicates imply the associated basic non-triviality predicates.
Diagnose C union globals that are non-trivial to default-initialize. Add 3 bits to RecordDeclBitfields for default-initialize, destruct, and copy to fast-path checking.
Jul 10 2019
I didn't know spaces are not allowed between "CHECK" and ":". CodeGen tests LGTM.
Address review comments.
Jul 9 2019
Add a bit to RecordDeclBitfields that indicates whether the record has a non-trivial C union member.
Jul 8 2019
Jul 3 2019
Add an implicit-only attribute ObjCDefaultedAnyToId to avoid passing the flag down.
Jul 2 2019
Call hasNonTrivialPrimitiveCStruct to check whether the type is a non-trivial C struct/union before calling checkNonTrivialCUnion. Fix comments.
Jul 1 2019
Jun 28 2019
Add function Expr::hasNonOverloadPlaceholderType.
Currently a block captures a variable (POD or non-POD) by reference if the enclosing lambda captures it by reference and captures by copy if the enclosing lambda captures by copy.
Jun 27 2019
Address review comments. Diagnose lvalue-to-rvalue conversion of volatile non-trivial C types.
Jun 26 2019
This patch should diagnose lvalue-to-rvalue conversion of volatile non-trivial C unions too, but it currently doesn't.
Jun 25 2019
Jun 14 2019
Address review comments.
Richard, could you shed light on why it's done this way?
I think I now have a better idea of what's causing the crash in IRGen.
- Add another test case which has a block nested inside a lambda and causes clang to crash.
- Fix the capture type passed to addCapture in RebuildLambdaScopeInfo.
Jun 13 2019
There are many attributes that start with objc_ including objc_arc_weak_reference_unavailable.
Jun 12 2019
John and I had a discussion offline and decided that we should not pursue the approach taken in this patch. I'll try to work on a patch that follows the C++11 approach when I have time later.
Jun 11 2019
How do you write correct (non-leaking, non-double-freeing, non-releasing-invalid-pointers) code with this attribute? For example, suppose I have a __strong union member: does storing to it release the old value (which might be a different union member)? If so, how do you work around that? https://clang.llvm.org/docs/AutomaticReferenceCounting.html#ownership-qualified-fields-of-structs-and-unions should be updated to say what happens. If manual reference counting code is required to make any use of this feature correct (which seems superficially likely), is this a better programming model than __unsafe_unretained?
Jun 10 2019
I agree. Something like arc_inert is probably a better name in this case for the reason you mentioned.
Does this lead to C/C++ ABI mismatches? Should we just honor this in C++ as well by ignoring it when deciding to delete special members? Is taking such a general name a good idea if it's language-specific? Richard, thoughts?
Jun 6 2019
Jun 5 2019
Address review comments.
Jun 4 2019
Jun 3 2019
Just set isClassMessage instead of passing a separate flag to tryGenerateSpecializedMessageSend.