ItaniumDemangler: Update BinaryExpr::match to match the ctor

Not sure if this could use more testing, but hopefully this is adequate.
This commit is contained in:
David Blaikie 2022-03-28 21:21:37 +00:00
parent ff60af91ac
commit 1d1cf9b6c4
2 changed files with 7 additions and 1 deletions

View File

@ -1782,7 +1782,9 @@ public:
: Node(KBinaryExpr, Prec_), LHS(LHS_), InfixOperator(InfixOperator_),
RHS(RHS_) {}
template<typename Fn> void match(Fn F) const { F(LHS, InfixOperator, RHS); }
template <typename Fn> void match(Fn F) const {
F(LHS, InfixOperator, RHS, getPrecedence());
}
void printLeft(OutputBuffer &OB) const override {
bool ParenAll = OB.isGtInsideTemplateArgs() && InfixOperator == ">";

View File

@ -172,6 +172,10 @@ struct DumpVisitor {
return printStr("TemplateParamKind::Template");
}
}
void print(llvm::itanium_demangle::Node::Prec) {
// Do nothing, the printing functions handle precedence with parentheses
// already.
}
void newLine() {
printStr("\n");