Skip to content

Commit 959814d

Browse files
committed
fixup! Address review comments
1 parent a5fda5b commit 959814d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/lib/TableGen/Record.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ const Init *BinOpInit::Fold(const Record *CurRec) const {
15571557
}
15581558

15591559
const Init *BinOpInit::resolveReferences(Resolver &R) const {
1560-
const Init *lhs = LHS->resolveReferences(R);
1560+
const Init *NewLHS = LHS->resolveReferences(R);
15611561

15621562
unsigned Opc = getOpcode();
15631563
if (Opc == AND || Opc == OR) {
@@ -1569,17 +1569,17 @@ const Init *BinOpInit::resolveReferences(Resolver &R) const {
15691569
// limited version of short-circuit against all ones (`true` is casted
15701570
// to 1 rather than all ones before we evaluate `!or`).
15711571
if (const auto *LHSi = dyn_cast_or_null<IntInit>(
1572-
lhs->convertInitializerTo(IntRecTy::get(getRecordKeeper())))) {
1572+
NewLHS->convertInitializerTo(IntRecTy::get(getRecordKeeper())))) {
15731573
if ((Opc == AND && !LHSi->getValue()) ||
15741574
(Opc == OR && LHSi->getValue() == -1))
15751575
return LHSi;
15761576
}
15771577
}
15781578

1579-
const Init *rhs = RHS->resolveReferences(R);
1579+
const Init *NewRHS = RHS->resolveReferences(R);
15801580

1581-
if (LHS != lhs || RHS != rhs)
1582-
return (BinOpInit::get(getOpcode(), lhs, rhs, getType()))
1581+
if (LHS != NewLHS || RHS != NewRHS)
1582+
return (BinOpInit::get(getOpcode(), NewLHS, NewRHS, getType()))
15831583
->Fold(R.getCurrentRecord());
15841584
return this;
15851585
}

llvm/test/TableGen/true-false.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def rec7 {
6767
bits<3> flags = { true, false, true };
6868
}
6969

70-
// `!and` and `!or` should be short-circuit such that any of the `!head` or
70+
// `!and` and `!or` should be short-circuited such that any of the `!head` or
7171
// `!tail` on empty list below will never be evaluated.
7272
// CHECK: def rec8
7373
// CHECK: bit v = 0;

0 commit comments

Comments
 (0)