================
@@ -697,10 +697,46 @@ static TemplateParamInfo convertTemplateArgToInfo(const
clang::Decl *D,
return TemplateParamInfo(Str);
}
+// Check if the DeclKind is one for which we support contextual relationships.
+// There might be other ContextDecls, like blocks, that we currently don't
+// handle at all.
+static bool isSupportedContext(Decl::Kind DeclKind) {
+ switch (DeclKind) {
+ case Decl::Kind::Record:
+ case Decl::Kind::CXXRecord:
+ case Decl::Kind::ClassTemplateSpecialization:
+ case Decl::Kind::ClassTemplatePartialSpecialization:
+ case Decl::Kind::Namespace:
+ return true;
+ default:
+ return false;
+ }
+}
+
+template <typename T> static void findParent(Info &I, const T *D) {
----------------
ilovepi wrote:
Actually, does this need to be a template? Aren't all the things passed in here
`clangDecl`? IIRC all types that can be cast to `DeclContext` should also be
`Decl`. Besides, `getKind()` is a `Decl` method.
https://github.com/llvm/llvm-project/pull/173297
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits