Hello,

When playing with (inheriting from) "RecursiveASTVisitor", I observed
that "::TraverseBinAssign" (and other traversers of binary operators)
were never called. Except "::TraverseBinPtrMemD".

My investigations led me to the implementation of
"RecursiveASTVisitor<Derived>::TraverseStmt" (line 386 of
RecursiveASTVisitor.h), which says (line 393):

       if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(S)) {
         switch (BinOp->getOpcode()) {
     #define OPERATOR(NAME) \
         case BO_##NAME: DISPATCH(Bin##PtrMemD, BinaryOperator, S);

(See how every case of the switch actually dispatch to BinPtrMemD only)

Shouldn't it be the following:

     #define OPERATOR(NAME) \
         case BO_##NAME: DISPATCH(Bin##NAME, BinaryOperator, S);

?


Regards,
--
Benoit PERROT


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

(TraverseStmt) Effectively dispatch binary operators to specialized Traversers.

--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Tue Dec  7 09:56:06 2010
@@ -393,7 +393,7 @@
   if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(S)) {
     switch (BinOp->getOpcode()) {
 #define OPERATOR(NAME) \
-    case BO_##NAME: DISPATCH(Bin##PtrMemD, BinaryOperator, S);
+    case BO_##NAME: DISPATCH(Bin##NAME, BinaryOperator, S);
 
     BINOP_LIST()
 #undef OPERATOR
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to