[PATCH] D94366: [Clang] Emit mustprogress for infinite C++ loops

Atmn Patel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 9 15:17:26 PST 2021


atmnpatel created this revision.
atmnpatel added reviewers: fhahn, jdoerfert, xbolva00.
atmnpatel requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Currently, clang does not emit the `mustprogress` loop or function
attribute for loops with non-zero constant conditionals. Based on recent
discussion in D86844 <https://reviews.llvm.org/D86844> and D86841 <https://reviews.llvm.org/D86841>, it seems that it would be preferable to
emit these attributes to adhere more tightly to the C++ standard as gcc
does.

I will be pushing a patch to add `-ffinite-loops` and `-fno-finite-loops` to
clang to provide more control over this momentarily.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94366

Files:
  clang/lib/CodeGen/CGStmt.cpp
  clang/test/CodeGen/attr-mustprogress-1.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94366.315638.patch
Type: text/x-patch
Size: 9962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210109/5d648afc/attachment-0001.bin>


More information about the cfe-commits mailing list