diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-07-17 21:27:49 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-07-17 21:27:49 +0000 |
commit | 75c5754260b4a3a0ff7f6437c850be9f95cad836 (patch) | |
tree | f2530ef48a4fd207cb58655df2db90167c8f8d17 | |
parent | 76e7edddfa0692097a94c32fff0bc5f5f4512cff (diff) |
Try to eliminate GCC_CAST hack in a manner that should work for both
GCC and MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160397 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/RecursiveASTVisitor.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index 2e56a486f3..fa272ffdc2 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -464,19 +464,11 @@ template<typename Derived> bool RecursiveASTVisitor<Derived>::dataTraverseNode(Stmt *S, bool &EnqueueChildren) { -// The cast for DISPATCH_WALK is needed for older versions of g++, but causes -// problems for MSVC. So we'll skip the cast entirely for MSVC. -#if defined(_MSC_VER) - #define GCC_CAST(CLASS) -#else - #define GCC_CAST(CLASS) (bool (RecursiveASTVisitor::*)(CLASS*)) -#endif - // Dispatch to the corresponding WalkUpFrom* function only if the derived // class didn't override Traverse* (and thus the traversal is trivial). #define DISPATCH_WALK(NAME, CLASS, VAR) \ - if (&RecursiveASTVisitor::Traverse##NAME == \ - GCC_CAST(CLASS)&Derived::Traverse##NAME) \ + if ((bool (Derived::*)(CLASS*))&RecursiveASTVisitor::Traverse##NAME == \ + &Derived::Traverse##NAME) \ return getDerived().WalkUpFrom##NAME(static_cast<CLASS*>(VAR)); \ EnqueueChildren = false; \ return getDerived().Traverse##NAME(static_cast<CLASS*>(VAR)); @@ -516,7 +508,6 @@ bool RecursiveASTVisitor<Derived>::dataTraverseNode(Stmt *S, } #undef DISPATCH_WALK -#undef GCC_CAST return true; } |