diff options
| author | David Blaikie <dblaikie@gmail.com> | 2013-02-18 19:04:16 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2013-02-18 19:04:16 +0000 |
| commit | b61d087d4044a4c53bffc7072b4adb9306bd0466 (patch) | |
| tree | 313fef7a3794ee4b88aaa70a6046113fd5a184b1 | |
| parent | 6ebe3959aa664be2c508471a58d4b3465b9a25fb (diff) | |
| download | bcm5719-llvm-b61d087d4044a4c53bffc7072b4adb9306bd0466.tar.gz bcm5719-llvm-b61d087d4044a4c53bffc7072b4adb9306bd0466.zip | |
Clean up last use of dyn_cast on TypeLoc in ASTMatchers
llvm-svn: 175454
| -rw-r--r-- | clang/include/clang/ASTMatchers/ASTMatchersMacros.h | 6 | ||||
| -rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/clang/include/clang/ASTMatchers/ASTMatchersMacros.h b/clang/include/clang/ASTMatchers/ASTMatchersMacros.h index b2629c66274..f5ca26bca73 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchersMacros.h +++ b/clang/include/clang/ASTMatchers/ASTMatchersMacros.h @@ -273,9 +273,9 @@ /// \brief Creates a variadic matcher for both a specific \c Type as well as /// the corresponding \c TypeLoc. #define AST_TYPE_MATCHER(NodeType, MatcherName) \ - const internal::VariadicDynCastAllOfMatcher<Type, NodeType> MatcherName; \ - const internal::VariadicDynCastAllOfMatcher<TypeLoc, \ - NodeType##Loc> MatcherName##Loc + const internal::VariadicDynCastAllOfMatcher<Type, NodeType> MatcherName +// FIXME: add a matcher for TypeLoc derived classes using its custom casting +// API (no longer dyn_cast) if/when we need such matching /// \brief AST_TYPE_TRAVERSE_MATCHER(MatcherName, FunctionName) defines /// the matcher \c MatcherName that can be used to traverse from one \c Type diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 129f90f2dc1..608e7479a6b 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -673,7 +673,7 @@ TEST(HasDescendant, MatchesDescendantsOfTypes) { qualType(hasDescendant( pointerType(pointee(builtinType())))))); EXPECT_TRUE(matches("void f() { int*** i; }", - typeLoc(hasDescendant(builtinTypeLoc())))); + typeLoc(hasDescendant(loc(builtinType()))))); EXPECT_TRUE(matchAndVerifyResultTrue( "void f() { int*** i; }", @@ -3279,7 +3279,7 @@ TEST(TypeMatching, PointerTypes) { // new VerifyIdIsBoundTo<TypeLoc>("loc", 1))); EXPECT_TRUE(matches( "int** a;", - pointerTypeLoc(pointeeLoc(loc(qualType()))))); + loc(pointerType(pointee(qualType()))))); EXPECT_TRUE(matches( "int** a;", loc(pointerType(pointee(pointerType()))))); @@ -3324,7 +3324,7 @@ TEST(TypeMatching, PointeeTypes) { EXPECT_TRUE(matches("int *a;", pointerType(pointee(builtinType())))); EXPECT_TRUE(matches("int *a;", - pointerTypeLoc(pointeeLoc(loc(builtinType()))))); + loc(pointerType(pointee(builtinType()))))); EXPECT_TRUE(matches( "int const *A;", @@ -3338,10 +3338,10 @@ TEST(TypeMatching, MatchesPointersToConstTypes) { EXPECT_TRUE(matches("int b; int * const a = &b;", loc(pointerType()))); EXPECT_TRUE(matches("int b; int * const a = &b;", - pointerTypeLoc())); + loc(pointerType()))); EXPECT_TRUE(matches( "int b; const int * a = &b;", - pointerTypeLoc(pointeeLoc(builtinTypeLoc())))); + loc(pointerType(pointee(builtinType()))))); EXPECT_TRUE(matches( "int b; const int * a = &b;", pointerType(pointee(builtinType())))); |

