mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	[ObjCARC] Turn off ignoring unwind edges in ObjCARC when -fno-objc-arc-exception is enabled due to it's affect on correctness.
Specifically according to the semantics of ARC -fno-objc-arc-exception simply states that it is expected that the unwind path out of a call *MAY* not release objects. Thus we can have the situation where a release gets moved into a catch block which we ignore when we remove a retain/release pair resulting in (even though we assume the program is exiting anyways) the cleanup code path potentially blowing up before program exit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172599 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -2675,17 +2675,6 @@ ObjCARCOpt::CheckForCFGHazards(const BasicBlock *BB, | |||||||
|       PtrState &S = I->second; |       PtrState &S = I->second; | ||||||
|       succ_const_iterator SI(TI), SE(TI, false); |       succ_const_iterator SI(TI), SE(TI, false); | ||||||
|  |  | ||||||
|       // If the terminator is an invoke marked with the |  | ||||||
|       // clang.arc.no_objc_arc_exceptions metadata, the unwind edge can be |  | ||||||
|       // ignored, for ARC purposes. |  | ||||||
|       if (isa<InvokeInst>(TI) && TI->getMetadata(NoObjCARCExceptionsMDKind)) { |  | ||||||
|         DEBUG(dbgs() << "ObjCARCOpt::CheckForCFGHazards: Found an invoke " |  | ||||||
|                         "terminator marked with " |  | ||||||
|                         "clang.arc.no_objc_arc_exceptions. Ignoring unwind " |  | ||||||
|                         "edge.\n"); |  | ||||||
|         --SE; |  | ||||||
|       } |  | ||||||
|  |  | ||||||
|       for (; SI != SE; ++SI) { |       for (; SI != SE; ++SI) { | ||||||
|         Sequence SuccSSeq = S_None; |         Sequence SuccSSeq = S_None; | ||||||
|         bool SuccSRRIKnownSafe = false; |         bool SuccSRRIKnownSafe = false; | ||||||
| @@ -2734,17 +2723,6 @@ ObjCARCOpt::CheckForCFGHazards(const BasicBlock *BB, | |||||||
|       PtrState &S = I->second; |       PtrState &S = I->second; | ||||||
|       succ_const_iterator SI(TI), SE(TI, false); |       succ_const_iterator SI(TI), SE(TI, false); | ||||||
|  |  | ||||||
|       // If the terminator is an invoke marked with the |  | ||||||
|       // clang.arc.no_objc_arc_exceptions metadata, the unwind edge can be |  | ||||||
|       // ignored, for ARC purposes. |  | ||||||
|       if (isa<InvokeInst>(TI) && TI->getMetadata(NoObjCARCExceptionsMDKind)) { |  | ||||||
|         DEBUG(dbgs() << "ObjCARCOpt::CheckForCFGHazards: Found an invoke " |  | ||||||
|                         "terminator marked with " |  | ||||||
|                         "clang.arc.no_objc_arc_exceptions. Ignoring unwind " |  | ||||||
|                         "edge.\n"); |  | ||||||
|         --SE; |  | ||||||
|       } |  | ||||||
|  |  | ||||||
|       for (; SI != SE; ++SI) { |       for (; SI != SE; ++SI) { | ||||||
|         Sequence SuccSSeq = S_None; |         Sequence SuccSSeq = S_None; | ||||||
|         bool SuccSRRIKnownSafe = false; |         bool SuccSRRIKnownSafe = false; | ||||||
| @@ -3199,17 +3177,6 @@ ComputePostOrders(Function &F, | |||||||
|     TerminatorInst *TI = cast<TerminatorInst>(&CurrBB->back()); |     TerminatorInst *TI = cast<TerminatorInst>(&CurrBB->back()); | ||||||
|     succ_iterator SE(TI, false); |     succ_iterator SE(TI, false); | ||||||
|  |  | ||||||
|     // If the terminator is an invoke marked with the |  | ||||||
|     // clang.arc.no_objc_arc_exceptions metadata, the unwind edge can be |  | ||||||
|     // ignored, for ARC purposes. |  | ||||||
|     if (isa<InvokeInst>(TI) && TI->getMetadata(NoObjCARCExceptionsMDKind)) { |  | ||||||
|         DEBUG(dbgs() << "ObjCARCOpt::ComputePostOrders: Found an invoke " |  | ||||||
|                         "terminator marked with " |  | ||||||
|                         "clang.arc.no_objc_arc_exceptions. Ignoring unwind " |  | ||||||
|                         "edge.\n"); |  | ||||||
|       --SE; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     while (SuccStack.back().second != SE) { |     while (SuccStack.back().second != SE) { | ||||||
|       BasicBlock *SuccBB = *SuccStack.back().second++; |       BasicBlock *SuccBB = *SuccStack.back().second++; | ||||||
|       if (Visited.insert(SuccBB)) { |       if (Visited.insert(SuccBB)) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user