[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-10 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-10 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/77214 From 766df92436569a924ef1c3860b3e1019c2048b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Wed, 10 Jan 2024 10:00:31 +0100 Subject: [PATCH] [coverage] fix incorrect coverage

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-10 Thread via cfe-commits
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= Message-ID: In-Reply-To: cor3ntin wrote: Oups, can you rebase? https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-09 Thread Hana Dusíková via cfe-commits
hanickadot wrote: yes please, I don't have merge rights https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-09 Thread via cfe-commits
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= Message-ID: In-Reply-To: https://github.com/cor3ntin approved this pull request. LGTM @hanickadot do you need me to merge that for you? https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= Message-ID: In-Reply-To: https://github.com/ornata approved this pull request. https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= Message-ID: In-Reply-To: ornata wrote: LGTM https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Hana Dusíková via cfe-commits
@@ -7732,7 +7732,11 @@ TreeTransform::TransformIfStmt(IfStmt *S) { if (Then.isInvalid()) return StmtError(); } else { -Then = new (getSema().Context) NullStmt(S->getThen()->getBeginLoc()); +// Discarded branch is replaced with empty CompoundStmt so we can

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/77214 From 413517b2a1d4e45b6c58ab282c7990e83f429ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Mon, 8 Jan 2024 11:54:45 +0100 Subject: [PATCH 1/2] [coverage] fix incorrect coverage

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
@@ -98,3 +104,49 @@ int main() {// CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = void ternary() { true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 -> } + +// FIXME: Do not generate coverage for discarded branches in if consteval +// GH-57377 +//

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
@@ -98,3 +104,49 @@ int main() {// CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = void ternary() { true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 -> } + +// FIXME: Do not generate coverage for discarded branches in if consteval +// GH-57377 +//

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
@@ -23,19 +23,29 @@ void foo() {// CHECK-NEXT: Gap,File 0, [[@LINE+1]]:21 -> [[@ } // CHECK-NEXT: [[@LINE-2]]:9 -> [[@LINE-1]]:5 = #1 // CHECK-NEXT: [[@LINE-2]]:5 -> [[@LINE-2]]:8 = #1 -//

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
@@ -98,3 +104,49 @@ int main() {// CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = void ternary() { true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 -> } + +// FIXME: Do not generate coverage for discarded branches in if consteval +// GH-57377 +//

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
@@ -7741,6 +7745,10 @@ TreeTransform::TransformIfStmt(IfStmt *S) { Else = getDerived().TransformStmt(S->getElse()); if (Else.isInvalid()) return StmtError(); + } else if (S->getElse() && ConstexprConditionValue && ornata wrote: Could you add a

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
@@ -23,19 +23,29 @@ void foo() {// CHECK-NEXT: Gap,File 0, [[@LINE+1]]:21 -> [[@ } // CHECK-NEXT: [[@LINE-2]]:9 -> [[@LINE-1]]:5 = #1 // CHECK-NEXT: [[@LINE-2]]:5 -> [[@LINE-2]]:8 = #1 -//

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
@@ -98,3 +104,49 @@ int main() {// CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = void ternary() { true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 -> } + +// FIXME: Do not generate coverage for discarded branches in if consteval +// GH-57377 +//

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
https://github.com/ornata commented: Added some comments, mostly nits on the test. https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
@@ -7732,7 +7732,11 @@ TreeTransform::TransformIfStmt(IfStmt *S) { if (Then.isInvalid()) return StmtError(); } else { -Then = new (getSema().Context) NullStmt(S->getThen()->getBeginLoc()); +// Discarded branch is replaced with empty CompoundStmt so we can

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
@@ -98,3 +104,49 @@ int main() {// CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = void ternary() { true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 -> } + +// FIXME: Do not generate coverage for discarded branches in if consteval +// GH-57377 +//

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Jessica Paquette via cfe-commits
https://github.com/ornata edited https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Hana Dusíková via cfe-commits
hanickadot wrote: Added some tests. And also adding @ornata for review. https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/77214 From 413517b2a1d4e45b6c58ab282c7990e83f429ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Mon, 8 Jan 2024 11:54:45 +0100 Subject: [PATCH] [coverage] fix incorrect coverage

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-08 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/77214 From 2dc9d821aa3d100f99ac603a0880498226c94323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 7 Jan 2024 00:13:08 +0100 Subject: [PATCH 1/2] [coverage] fix incorrect coverage

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/77214 From 5aa041529997724e19109c45cf1483eb72d7dab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 7 Jan 2024 00:13:08 +0100 Subject: [PATCH] [coverage] fix incorrect coverage

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread Hana Dusíková via cfe-commits
hanickadot wrote: Yes, and it will be a bit bigger change. This is currently my biggest change yet :) But I want to do it as next. This fix's intention is to make the source location of regions properly done. https://github.com/llvm/llvm-project/pull/77214

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread Paweł Bylica via cfe-commits
chfast wrote: > But in future it would be useful to mark whole gap there as skipped instead. > If there is interest I would do it in another PR. This would be very useful not to treat compile-time unreachable code as uncovered. Can the skipped code be marked separately in the reports?

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/77214 From fb2efdecce3a629c801d1f179297b1189e1ec287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 7 Jan 2024 00:13:08 +0100 Subject: [PATCH] [coverage] fix incorrect coverage

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread Hana Dusíková via cfe-commits
@@ -7732,7 +7732,8 @@ TreeTransform::TransformIfStmt(IfStmt *S) { if (Then.isInvalid()) return StmtError(); } else { -Then = new (getSema().Context) NullStmt(S->getThen()->getBeginLoc()); +Then = new (getSema().Context) +

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread via cfe-commits
cor3ntin wrote: Adding a few folks to the review (We do not seem to update the coverage mapping very often) https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/77214 From 1891847f50311c4ffbaa40577900eca2245c0a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 7 Jan 2024 00:13:08 +0100 Subject: [PATCH] [coverage] fix incorrect coverage

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread via cfe-commits
@@ -1631,8 +1631,10 @@ class CompoundStmt final SourceLocation RB); // Build an empty compound statement with a location. - explicit CompoundStmt(SourceLocation Loc) - : Stmt(CompoundStmtClass), LBraceLoc(Loc), RBraceLoc(Loc) { +

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread Hana Dusíková via cfe-commits
hanickadot wrote: Fixes https://github.com/llvm/llvm-project/issues/54419. https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread via cfe-commits
@@ -1631,8 +1631,10 @@ class CompoundStmt final SourceLocation RB); // Build an empty compound statement with a location. - explicit CompoundStmt(SourceLocation Loc) - : Stmt(CompoundStmtClass), LBraceLoc(Loc), RBraceLoc(Loc) { +

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread via cfe-commits
https://github.com/cor3ntin commented: Thanks for the patch! I think this might need a release note (referencing the couple open issues about this bug), and probably some tests. https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread via cfe-commits
@@ -7732,7 +7732,8 @@ TreeTransform::TransformIfStmt(IfStmt *S) { if (Then.isInvalid()) return StmtError(); } else { -Then = new (getSema().Context) NullStmt(S->getThen()->getBeginLoc()); +Then = new (getSema().Context) +

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/77214 From bde3362e609a129f410890745b1dcfd635ba2ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 7 Jan 2024 00:13:08 +0100 Subject: [PATCH] [coverage] fix incorrect coverage

[mlir] [llvm] [clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-07 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/77214 From 8f1370aae4db2048c35516a85fb72c742557942b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 7 Jan 2024 00:13:08 +0100 Subject: [PATCH] [coverage] fix incorrect coverage

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-06 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-06 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/77214 From 8f1370aae4db2048c35516a85fb72c742557942b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Sun, 7 Jan 2024 00:13:08 +0100 Subject: [PATCH] [coverage] fix incorrect coverage

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-06 Thread Hana Dusíková via cfe-commits
hanickadot wrote: https://github.com/llvm/llvm-project/assets/6557263/47ff77c0-9101-44cf-b2d5-ffea514bfc0c;> (notice wrong coverage "if constexpr" for positive one, and completely missing for negative one, also notice "if consteval" marking always the same branch as uncovered)

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-06 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot edited https://github.com/llvm/llvm-project/pull/77214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Hana Dusíková (hanickadot) Changes It was a while since I noticed coverage report is broken for "if constexpr" and "if consteval" (as shown on first picture). img width="453" alt="Screenshot 2024-01-07 at 00 29 17"

[clang] [clang][coverage] fixing "if constexpr" and "if consteval" coverage report (PR #77214)

2024-01-06 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot created https://github.com/llvm/llvm-project/pull/77214 It was a while since I noticed coverage report is broken for "if constexpr" and "if consteval" (as shown on first picture).