function markReturnStatementsOnSegmentAsUsed(
			segment,
			usedUnreachableSegments,
		) {
			if (!segment.reachable) {
				usedUnreachableSegments.add(segment);
				segment.allPrevSegments
					.filter(isReturned)
					.filter(
						prevSegment =>
							!usedUnreachableSegments.has(prevSegment),
					)
					.forEach(prevSegment =>
						markReturnStatementsOnSegmentAsUsed(
							prevSegment,
							usedUnreachableSegments,
						),
					);
				return;
			}

			const info = segmentInfoMap.get(segment);

			if (!info) {
				return;
			}

			info.uselessReturns = info.uselessReturns.filter(node => {
				if (
					scopeInfo.traversedTryBlockStatements &&
					scopeInfo.traversedTryBlockStatements.length > 0
				) {
					const returnInitialRange = node.range[0];
					const returnFinalRange = node.range[1];

					const areBlocksInRange =
						scopeInfo.traversedTryBlockStatements.some(
							tryBlockStatement => {
								const blockInitialRange =
									tryBlockStatement.range[0];
								const blockFinalRange =
									tryBlockStatement.range[1];

								return (
									returnInitialRange >= blockInitialRange &&
									returnFinalRange <= blockFinalRange
								);
							},
						);

					if (areBlocksInRange) {
						return true;
					}
				}

				remove(scopeInfo.uselessReturns, node);
				return false;
			});
		}
Removes the return statements on the given segment from the useless return
statement list.

This segment may be an unreachable segment.
In that case, the information object of the unreachable segment is not
initialized because `onCodePathSegmentStart` event is not notified for
unreachable segments.
This goes to the previous segments of the unreachable segment recursively
if the unreachable segment was generated by a return statement. Otherwise,
this ignores the unreachable segment.

This behavior would simulate code paths for the case that the return
statement does not exist.
@param {CodePathSegment} segment The segment to get return statements.
@param {Set<CodePathSegment>} usedUnreachableSegments A set of segments that have already been traversed in this call.
@returns {void}