[clang][ExtractAPI] Refactor ExtractAPIVisitor to make it more extensible
authorDaniel Grumberg <dgrumberg@apple.com>
Wed, 22 Mar 2023 18:43:24 +0000 (18:43 +0000)
committerDaniel Grumberg <dgrumberg@apple.com>
Mon, 27 Mar 2023 16:24:10 +0000 (17:24 +0100)
commitea35740e7e189cdcdd88344ac60a53a5b8a8318d
treec35fa1e7b1279cbb5a3bba215e48267e0ee88253
parent0ceb7a12dbfd2035959d3791b96c923c0e1e89fc
[clang][ExtractAPI] Refactor ExtractAPIVisitor to make it more extensible

Use CRTP to enable creating statically dispatched subclasses of
ExtractAPIVisitor.
This enables adding extension points and customising the behavior more
easily.

This is used in CXExtractAPI.cpp to create a specialized visitor for
Libclang as well as streamlining the batch implementation in ExtractAPIConsumer.cpp
clang/include/clang/ExtractAPI/ExtractAPIVisitor.h
clang/include/clang/ExtractAPI/TypedefUnderlyingTypeResolver.h [moved from clang/lib/ExtractAPI/TypedefUnderlyingTypeResolver.h with 100% similarity]
clang/lib/ExtractAPI/CMakeLists.txt
clang/lib/ExtractAPI/DeclarationFragments.cpp
clang/lib/ExtractAPI/ExtractAPIConsumer.cpp
clang/lib/ExtractAPI/ExtractAPIVisitor.cpp [deleted file]
clang/lib/ExtractAPI/TypedefUnderlyingTypeResolver.cpp
clang/tools/libclang/CXExtractAPI.cpp