[PATCH] D153557: [clang][ExtractAPI] Add support for C++ classes

Erick Velez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 29 17:58:34 PDT 2023


evelez7 added a comment.

There aren't any variables or fields in the tests currently, waiting on D154038 <https://reviews.llvm.org/D154038> because of no semicolons in their fragments.



================
Comment at: clang/lib/ExtractAPI/API.cpp:19
 #include "clang/AST/RawCommentList.h"
+#include "clang/ExtractAPI/DeclarationFragments.h"
 #include "clang/Index/USRGeneration.h"
----------------
dang wrote:
> AccessControl should move into API.h so we don't need to pull in DeclarationFragments.h
This include doesn't need to be here, clangd auto-included it. Using `FunctionSignature` would've explicitly included it in the first place. DeclarationFragments.h is already included in API.h.

I was following `FunctionSignature` as far as where to declare and define. Moving `AccessControl` would mean including API.h in DeclarationFragments.h to allow `DeclarationFragmentsBuilder::getAccessControl`.


================
Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:607
-  // correctly here.
-  Obj["accessLevel"] = "public";
   SmallVector<StringRef, 4> PathComponentsNames;
----------------
dang wrote:
> We still need all symbols to have an "accessLevel" specifier. Maybe the false_type overload of `serializeAccessMixin` could make "public" the default.
This is done on line 534. "public" is serialized if the returned optional is empty.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153557/new/

https://reviews.llvm.org/D153557



More information about the cfe-commits mailing list