Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/Demangle/ItaniumDemangle.h
Show First 20 Lines • Show All 1,779 Lines • ▼ Show 20 Lines | public: | ||||
BinaryExpr(const Node *LHS_, StringView InfixOperator_, const Node *RHS_, | BinaryExpr(const Node *LHS_, StringView InfixOperator_, const Node *RHS_, | ||||
Prec Prec_) | Prec Prec_) | ||||
: Node(KBinaryExpr, Prec_), LHS(LHS_), InfixOperator(InfixOperator_), | : Node(KBinaryExpr, Prec_), LHS(LHS_), InfixOperator(InfixOperator_), | ||||
RHS(RHS_) {} | 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); } | ||||
void printLeft(OutputBuffer &OB) const override { | void printLeft(OutputBuffer &OB) const override { | ||||
bool ParenAll = OB.isGtInsideTemplateArgs() && InfixOperator == ">"; | bool ParenAll = OB.isGtInsideTemplateArgs() && | ||||
(InfixOperator == ">" || InfixOperator == ">>"); | |||||
if (ParenAll) | if (ParenAll) | ||||
OB.printOpen(); | OB.printOpen(); | ||||
// Assignment is right associative, with special LHS precedence. | // Assignment is right associative, with special LHS precedence. | ||||
bool IsAssign = getPrecedence() == Prec::Assign; | bool IsAssign = getPrecedence() == Prec::Assign; | ||||
LHS->printAsOperand(OB, IsAssign ? Prec::OrIf : getPrecedence(), !IsAssign); | LHS->printAsOperand(OB, IsAssign ? Prec::OrIf : getPrecedence(), !IsAssign); | ||||
// No space before comma operator | // No space before comma operator | ||||
if (!(InfixOperator == ",")) | if (!(InfixOperator == ",")) | ||||
OB += " "; | OB += " "; | ||||
▲ Show 20 Lines • Show All 3,752 Lines • Show Last 20 Lines |