diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-08-26 22:08:29 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-08-26 22:08:29 +0000 |
| commit | 6d7b404d087af0dd23b01db12f0bfa520b22c17c (patch) | |
| tree | 8dfeba3a40978a661ce639a15603694bcf56c1b4 | |
| parent | 24fb6b2f8c5a9856556e667be803de4ffde27ea0 (diff) | |
| download | bcm5719-llvm-6d7b404d087af0dd23b01db12f0bfa520b22c17c.tar.gz bcm5719-llvm-6d7b404d087af0dd23b01db12f0bfa520b22c17c.zip | |
If a visitor doesn't define VisitBinMulAssign, fallback to VisitCompoundAssignOperator
instead of VisitBinaryOperator.
llvm-svn: 41462
| -rw-r--r-- | clang/include/clang/AST/StmtVisitor.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/clang/include/clang/AST/StmtVisitor.h b/clang/include/clang/AST/StmtVisitor.h index 38a38322f63..1c252965bde 100644 --- a/clang/include/clang/AST/StmtVisitor.h +++ b/clang/include/clang/AST/StmtVisitor.h @@ -129,13 +129,20 @@ public: BINOP_FALLBACK(LAnd) BINOP_FALLBACK(LOr) BINOP_FALLBACK(Assign) - BINOP_FALLBACK(MulAssign) BINOP_FALLBACK(DivAssign) BINOP_FALLBACK(RemAssign) - BINOP_FALLBACK(AddAssign) BINOP_FALLBACK(SubAssign) BINOP_FALLBACK(ShlAssign) - BINOP_FALLBACK(ShrAssign) BINOP_FALLBACK(AndAssign) BINOP_FALLBACK(OrAssign) - BINOP_FALLBACK(XorAssign) - BINOP_FALLBACK(Comma) #undef BINOP_FALLBACK + + // If the implementation doesn't implement compound assignment operator + // methods, fall back on VisitCompoundAssignOperator. +#define CAO_FALLBACK(NAME) \ + RetTy VisitBin ## NAME(CompoundAssignOperator *S) { \ + DISPATCH(CompoundAssignOperator, CompoundAssignOperator); \ + } + CAO_FALLBACK(MulAssign) CAO_FALLBACK(DivAssign) CAO_FALLBACK(RemAssign) + CAO_FALLBACK(AddAssign) CAO_FALLBACK(SubAssign) CAO_FALLBACK(ShlAssign) + CAO_FALLBACK(ShrAssign) CAO_FALLBACK(AndAssign) CAO_FALLBACK(OrAssign) + CAO_FALLBACK(XorAssign) +#undef CAO_FALLBACK // If the implementation doesn't implement unary operator methods, fall back // on VisitUnaryOperator. |

