llvm-project/clang/unittests/ASTMatchers
Stephane Moore a0a47d8ac1 [clang] Update isDerivedFrom to support Objective-C classes 🔍
Summary:
This change updates `isDerivedFrom` to support Objective-C classes by
converting it to a polymorphic matcher.

Notes:
The matching behavior for Objective-C classes is modeled to match the
behavior of `isDerivedFrom` with C++ classes. To that effect,
`isDerivedFrom` matches aliased types of derived Objective-C classes,
including compatibility aliases. To achieve this, the AST visitor has
been updated to map compatibility aliases to their underlying
Objective-C class.

`isSameOrDerivedFrom` also provides similar behaviors for C++ and
Objective-C classes. The behavior that
`cxxRecordDecl(isSameOrDerivedFrom("X"))` does not match
`class Y {}; typedef Y X;` is mirrored for Objective-C in that
`objcInterfaceDecl(isSameOrDerivedFrom("X"))` does not match either
`@interface Y @end typedef Y X;` or
`@interface Y @end @compatibility_alias X Y;`.

Test Notes:
Ran clang unit tests.

Reviewers: aaron.ballman, jordan_rose, rjmccall, klimek, alexfh, gribozavr

Reviewed By: aaron.ballman, gribozavr

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D60543

llvm-svn: 368632
2019-08-12 23:23:35 +00:00
..
Dynamic [clang] Update isDerivedFrom to support Objective-C classes 🔍 2019-08-12 23:23:35 +00:00
ASTMatchersInternalTest.cpp [clang] Remove IsDerivedFromDeathTest.DiesOnEmptyBaseName test. 2019-07-25 15:09:37 +00:00
ASTMatchersNarrowingTest.cpp [clang] Update isDerivedFrom to support Objective-C classes 🔍 2019-08-12 23:23:35 +00:00
ASTMatchersNodeTest.cpp [ASTTypeTraits][ASTMatchers][OpenMP] OMPClause handling 2019-03-21 15:33:24 +00:00
ASTMatchersTest.h Added AST matcher for ignoring elidable constructors 2019-06-13 13:48:24 +00:00
ASTMatchersTraversalTest.cpp [clang][NFC] Move matcher ignoringElidableConstructorCall's tests to appropriate file. 2019-08-08 18:55:42 +00:00
CMakeLists.txt cmake: Add CLANG_LINK_CLANG_DYLIB option 2019-07-03 22:45:55 +00:00