[ObjC][ARC] Invalidate an entry of UnderlyingObjCPtrCache when the
authorAkira Hatanaka <ahatanaka@apple.com>
Mon, 8 Nov 2021 22:39:16 +0000 (14:39 -0800)
committerAkira Hatanaka <ahatanaka@apple.com>
Mon, 8 Nov 2021 22:41:06 +0000 (14:41 -0800)
commitf2c7c3c7c7b19e77a2948de3c1dd982bf3840377
tree79a564e7f0cc4aef0e2fe3e0081e2a5aac05e642
parent443820179a849eac6ddb5cbf0ba5cc7bbc42e2d2
[ObjC][ARC] Invalidate an entry of UnderlyingObjCPtrCache when the
instruction the key points to is deleted

Use weak value handles for both the key and the value. The entry is
invalid if either value handle is null.

This fixes an assertion failure in BasicAAResult::alias that is caused
by UnderlyingObjCPtrCache returning a wrong value.

I don't have a test case for this patch that fails reliably.

rdar://83984790
llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h
llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.h