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

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 16 03:14:57 PST 2021


xbolva00 added inline comments.


================
Comment at: clang/lib/CodeGen/CGStmt.cpp:797
   if (llvm::ConstantInt *C = dyn_cast<llvm::ConstantInt>(BoolCondVal)) {
     if (C->isOne()) {
       EmitBoolCondBranch = false;
----------------
Anything non-zero?


================
Comment at: clang/test/CodeGen/attr-mustprogress-1.cpp:118
 void w1() {
   while (1)
     ;
----------------
Can you add test for eg. while (42) ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94366/new/

https://reviews.llvm.org/D94366



More information about the cfe-commits mailing list