Skip to content

Commit 6132e2c

Browse files
committed
Added the requested changes
1 parent fd81da4 commit 6132e2c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14983,12 +14983,11 @@ StmtResult SemaOpenMP::ActOnOpenMPUnrollDirective(ArrayRef<OMPClause *> Clauses,
1498314983
if (!VerifyPositiveIntegerConstantInClause(FactorVal, OMPC_partial,
1498414984
/*StrictlyPositive=*/true,
1498514985
/*SuppressExprDiags=*/false)
14986-
.isUsable()) {
14986+
.isUsable())
1498714987
return StmtError();
14988-
}
1498914988
// Checking if Iterator Variable Type can hold the Factor Width
14990-
auto FactorValWidth = FactorVal->getIntegerConstantExpr(Context)->getActiveBits();
14991-
auto IteratorVWidth = Context.getTypeSize(OrigVar->getType());
14989+
unsigned FactorValWidth = FactorVal->getIntegerConstantExpr(Context)->getActiveBits();
14990+
unsigned IteratorVWidth = Context.getTypeSize(OrigVar->getType());
1499214991
if ( FactorValWidth > IteratorVWidth ) {
1499314992
Diag(FactorVal->getExprLoc(), diag::err_omp_unroll_factor_width_mismatch)
1499414993
<< FactorValWidth << OrigVar->getType()
@@ -14998,7 +14997,6 @@ StmtResult SemaOpenMP::ActOnOpenMPUnrollDirective(ArrayRef<OMPClause *> Clauses,
1499814997

1499914998
Factor = FactorVal->getIntegerConstantExpr(Context)->getZExtValue();
1500014999
FactorLoc = FactorVal->getExprLoc();
15001-
1500215000
} else {
1500315001
// TODO: Use a better profitability model.
1500415002
Factor = 2;

0 commit comments

Comments
 (0)