[5/N] Fix clang-tidy warnings in jit (#131969)

Follows #131903
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131969
Approved by: https://github.com/ezyang
This commit is contained in:
cyy
2024-07-27 17:54:18 +00:00
committed by PyTorch MergeBot
parent 918ece4f4d
commit 8e5a367311
10 changed files with 82 additions and 94 deletions

View File

@ -263,8 +263,7 @@ struct ParserImpl {
}
Expr parseExp(int precedence) {
TreeRef prefix;
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
int unary_prec;
int unary_prec = 0;
if (shared.isUnary(L.cur().kind, &unary_prec)) {
auto kind = L.cur().kind;
auto pos = L.cur().range;
@ -283,8 +282,7 @@ struct ParserImpl {
} else {
prefix = parseBaseExp();
}
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
int binary_prec;
int binary_prec = 0;
while (shared.isBinary(L.cur().kind, &binary_prec)) {
if (binary_prec <= precedence) // not allowed to parse something which is
// not greater than 'precedence'