[ObjCARC] Tolerate missing attachedcall op by ignoring the bundle. #4211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In some situations (swiftc bitcode) we end up running the
objc-arc-contract pass twice, which is not supposed to occur.
This was fine until relatively recently, where the
clang.arc.attachedcall operand bundle support caused the second run to
crash: when emitting the calls, the pass was assuming that the bundle
always had an operand, which is not true in 5.6.
That will be true in the future, but that's a massive change.
For now, try to workaround the issue by ignoring the nullary bundles,
and not emitting the call.
The pass will get a little confused, but the semantics are preserved
by the presence of the intrinsic call later on (emitted by the first
run of the pass). However, one difference is that we're now going
to emit a redundant inline-asm marker, since we're not able to
eliminate the (standalone) intrinsic anymore, as we don't remember
emitting it in the pass. That costs us an extra nop, which is okay.
rdar://90366906