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

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 10 07:20:12 PST 2021


fhahn created this revision.
fhahn added reviewers: jdoerfert, rjmccall, xbolva00, atmnpatel, aaron.ballman, rsmith.
Herald added subscribers: dexonsmith, dang.
Herald added a reviewer: jansvoboda11.
fhahn requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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/D96419

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.c
  clang/test/CodeGenCXX/attr-mustprogress.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96419.322678.patch
Type: text/x-patch
Size: 17371 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210210/64d59924/attachment-0001.bin>


More information about the cfe-commits mailing list