Skip to content

Revert "[Coverage] Fix region termination for GNU statement expressions" #132095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions clang/lib/CodeGen/CoverageMappingGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1505,14 +1505,6 @@ struct CounterCoverageMappingBuilder
handleFileExit(getEnd(S));
}

void VisitStmtExpr(const StmtExpr *E) {
Visit(E->getSubStmt());
// Any region termination (such as a noreturn CallExpr) within the statement
// expression has been handled by visiting the sub-statement. The visitor
// cannot be at a terminate statement leaving the statement expression.
HasTerminateStmt = false;
}

void VisitDecl(const Decl *D) {
Stmt *Body = D->getBody();

Expand Down
7 changes: 0 additions & 7 deletions clang/test/CoverageMapping/terminate-statements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,6 @@ int elsecondnoret(void) {
return 0;
}

// CHECK-LABEL: _Z18statementexprnoretb
int statementexprnoret(bool crash) {
int rc = ({ if (crash) abort(); 0; }); // CHECK: File 0, 351:35 -> 352:12 = (#0 - #1)
return rc; // CHECK-NOT: Gap
}

int main() {
foo(0);
foo(1);
Expand All @@ -374,6 +368,5 @@ int main() {
ornoret();
abstractcondnoret();
elsecondnoret();
statementexprnoret(false);
return 0;
}
21 changes: 0 additions & 21 deletions compiler-rt/test/profile/Linux/coverage-statement-expression.cpp

This file was deleted.

Loading