[all-commits] [llvm/llvm-project] b5b311: [clang] Add -ffinite-loops & -fno-finite-loops opt...

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Feb 19 21:50:54 PST 2021


  Branch: refs/heads/release/12.x
  Home:   https://github.com/llvm/llvm-project
  Commit: b5b31112bf63debaa905e42785317a947e696252
      https://github.com/llvm/llvm-project/commit/b5b31112bf63debaa905e42785317a947e696252
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-02-19 (Fri, 19 Feb 2021)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Basic/CodeGenOptions.h
    M clang/include/clang/Driver/Options.td
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    R clang/test/CodeGen/attr-mustprogress-0.c
    R clang/test/CodeGen/attr-mustprogress-0.cpp
    R clang/test/CodeGen/attr-mustprogress-1.c
    R clang/test/CodeGen/attr-mustprogress-1.cpp
    A clang/test/CodeGen/attr-mustprogress.c
    A clang/test/CodeGenCXX/attr-mustprogress.cpp

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

This cherry-picks the following patches on the release branch:

6280bb4cd80e [clang] Remove redundant condition (NFC).
51bf4c0e6d4c [clang] Add -ffinite-loops & -fno-finite-loops options.
fb4d8fe80701 [clang] Update mustprogress tests

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.

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




More information about the All-commits mailing list