Skip to content
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

[clang][CodeGen] Keep processing the rest of AST after encountering unsupported MC/DC expressions #82464

Merged
merged 1 commit into from
Feb 22, 2024
Merged
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
11 changes: 7 additions & 4 deletions clang/lib/CodeGen/CodeGenPGO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,12 @@ struct MapRegionCounters : public RecursiveASTVisitor<MapRegionCounters> {
if (MCDCMaxCond == 0)
return true;

/// At the top of the logical operator nest, reset the number of conditions.
if (LogOpStack.empty())
/// At the top of the logical operator nest, reset the number of conditions,
/// also forget previously seen split nesting cases.
if (LogOpStack.empty()) {
NumCond = 0;
SplitNestedLogicalOp = false;
whentojump marked this conversation as resolved.
Show resolved Hide resolved
}

if (const Expr *E = dyn_cast<Expr>(S)) {
const BinaryOperator *BinOp = dyn_cast<BinaryOperator>(E->IgnoreParens());
Expand Down Expand Up @@ -292,7 +295,7 @@ struct MapRegionCounters : public RecursiveASTVisitor<MapRegionCounters> {
"contains an operation with a nested boolean expression. "
"Expression will not be covered");
Diag.Report(S->getBeginLoc(), DiagID);
return false;
return true;
whentojump marked this conversation as resolved.
Show resolved Hide resolved
}

/// Was the maximum number of conditions encountered?
Expand All @@ -303,7 +306,7 @@ struct MapRegionCounters : public RecursiveASTVisitor<MapRegionCounters> {
"number of conditions (%0) exceeds max (%1). "
"Expression will not be covered");
Diag.Report(S->getBeginLoc(), DiagID) << NumCond << MCDCMaxCond;
return false;
return true;
}

// Otherwise, allocate the number of bytes required for the bitmap
Expand Down
Loading