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

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Feb 12 11:27:12 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 51bf4c0e6d4cbc6dfa57857fc78003413cbeb17f
      https://github.com/llvm/llvm-project/commit/51bf4c0e6d4cbc6dfa57857fc78003413cbeb17f
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-02-12 (Fri, 12 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
    M clang/test/CodeGen/attr-mustprogress.c
    M clang/test/CodeGenCXX/attr-mustprogress.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list