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

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 17 01:52:43 PST 2021


fhahn created this revision.
Herald added subscribers: jansvoboda11, dexonsmith, dang.
fhahn requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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

6280bb4cd80e <https://reviews.llvm.org/rG6280bb4cd80e39b0e54b1c8dd091f2b7175381eb> [clang] Remove redundant condition (NFC).
51bf4c0e6d4c <https://reviews.llvm.org/rG51bf4c0e6d4cbc6dfa57857fc78003413cbeb17f> [clang] Add -ffinite-loops & -fno-finite-loops options.
fb4d8fe80701 <https://reviews.llvm.org/rGfb4d8fe807016fed221263d9a406e3856c8dfa4c> [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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96850

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96850.324235.patch
Type: text/x-patch
Size: 49659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210217/194ef782/attachment-0001.bin>


More information about the cfe-commits mailing list