[PATCH] D132723: [Clang] Fix crash in coverage of if consteval.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 05:32:31 PDT 2022


aaron.ballman added a comment.

Can you also add a release note?



================
Comment at: clang/lib/CodeGen/CoverageMappingGen.cpp:1375
     extendRegion(S);
+
     if (S->getInit())
----------------
Spurious whitespace change.


================
Comment at: clang/lib/CodeGen/CoverageMappingGen.cpp:1381-1383
+    if (!S->isConsteval()) {
+      extendRegion(S->getCond());
+    }
----------------
Fighting our usual crusade against braces.


================
Comment at: clang/lib/CodeGen/CoverageMappingGen.cpp:1407
       // The 'else' count applies to the area immediately after the 'then'.
-      Gap = findGapAreaBetween(getEnd(S->getThen()), getStart(Else));
+      auto Gap = findGapAreaBetween(getEnd(S->getThen()), getStart(Else));
       if (Gap)
----------------
1) Pick a name which doesn't shadow
2) Spell out the type instead of using `auto`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132723



More information about the cfe-commits mailing list