]> granicus.if.org Git - clang/commitdiff
If a visitor doesn't define VisitBinMulAssign, fallback to VisitCompoundAssignOperator
authorChris Lattner <sabre@nondot.org>
Sun, 26 Aug 2007 22:08:29 +0000 (22:08 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 26 Aug 2007 22:08:29 +0000 (22:08 +0000)
instead of VisitBinaryOperator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41462 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/StmtVisitor.h

index 38a38322f6355f40b45346f4942757fdb422b983..1c252965bde2bd77f9588d28122cce4630c3c410 100644 (file)
@@ -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.