llvm-project/llvm/lib/Transforms/ObjCARC
Akira Hatanaka 6fdcb3c2ce [ObjCARC] Do not move a release between a call and a
retainAutoreleasedReturnValue that retains the returned value.

This commit fixes a bug in ARC optimizer where it moves a release
between a call and a retainAutoreleasedReturnValue, causing the returned
object to be released before the retainAutoreleasedReturnValue can
retain it.

This commit accomplishes that by doing a lookahead and checking whether
the call prevents the release from moving upwards. In the long term, we
should treat the region between the retainAutoreleasedReturnValue and
the call as a critical section and disallow moving anything there
(possibly using operand bundles).

rdar://problem/20449878

llvm-svn: 301724
2017-04-29 00:23:11 +00:00
..
ARCRuntimeEntryPoints.h Rename AttributeSet to AttributeList 2017-03-21 16:57:19 +00:00
BlotMapVector.h
CMakeLists.txt
DependencyAnalysis.cpp
DependencyAnalysis.h
LLVMBuild.txt
ObjCARC.cpp
ObjCARC.h [ObjCARC] Do not move a release between a call and a 2017-04-29 00:23:11 +00:00
ObjCARCAPElim.cpp
ObjCARCContract.cpp [ObjCArc] Do not dereference an invalidated iterator. 2017-04-05 03:44:09 +00:00
ObjCARCExpand.cpp
ObjCARCOpts.cpp
ProvenanceAnalysis.cpp
ProvenanceAnalysis.h
ProvenanceAnalysisEvaluator.cpp
PtrState.cpp [ObjCARC] Do not move a release between a call and a 2017-04-29 00:23:11 +00:00
PtrState.h