[clang] Add -ffinite-loops & -fno-finite-loops options.

Authored by fhahn on Feb 12 2021, 9:45 AM.


[clang] Add -ffinite-loops & -fno-finite-loops options.

This patch adds 2 new options to control when Clang adds mustprogress:

  1. -ffinite-loops: assume all loops are finite; mustprogress is added to all loops, regardless of the selected language standard.
  2. -fno-finite-loops: assume no loop is finite; mustprogress is not added to any loop or function. We could add mustprogress to functions without loops, but we would have to detect that in Clang, which is probably not worth it.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D96419