[AST] Improve BinaryExpr

Abstract away the TupleExpr gunk and expose
`getLHS` and `getRHS` accessors. This is in
preparation for completely expunging the use
of TupleExpr as an argument list.
This commit is contained in:
Hamish Knight
2021-05-19 14:48:01 +01:00
parent 79102549b3
commit 46fa6e5721
20 changed files with 86 additions and 132 deletions

View File

@@ -412,11 +412,11 @@ std::pair<bool, Expr*> NameMatcher::walkToExprPre(Expr *E) {
case ExprKind::Binary: {
BinaryExpr *BinE = cast<BinaryExpr>(E);
// Visit in source order.
if (!BinE->getArg()->getElement(0)->walk(*this))
if (!BinE->getLHS()->walk(*this))
return {false, nullptr};
if (!BinE->getFn()->walk(*this))
return {false, nullptr};
if (!BinE->getArg()->getElement(1)->walk(*this))
if (!BinE->getRHS()->walk(*this))
return {false, nullptr};
// We already visited the children.