[PATCH] D48395: Added PublicOnly flag

Julie Hockett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 2 18:36:58 PDT 2018


juliehockett added a comment.

Please run clang-format and clang-tidy on the patch.



================
Comment at: clang-tools-extra/clang-doc/ClangDoc.cpp:25
 #include "clang/Frontend/FrontendActions.h"
+#include "Representation.h"
 
----------------
Sort includes (this should be at the top)


================
Comment at: clang-tools-extra/clang-doc/Mapper.cpp:13
 #include "Serialize.h"
+#include "Representation.h"
 #include "clang/AST/Comment.h"
----------------
Sort includes alphabetically, but you shouldn't need this here?


================
Comment at: clang-tools-extra/clang-doc/Mapper.h:23
 #include "clang/Tooling/Execution.h"
+#include "Representation.h"
 
----------------
Sort includes (this should be at the top)


================
Comment at: clang-tools-extra/clang-doc/Serialize.cpp:174
 
-static void parseFields(RecordInfo &I, const RecordDecl *D) {
+static bool isPublic(const clang::AccessSpecifier as, const clang::Linkage link){
+    if(as == clang::AccessSpecifier::AS_private)
----------------
clang-tidy will tell you to capitalize these in llvm world (as -> AS, link -> Link)


================
Comment at: clang-tools-extra/clang-doc/Serialize.cpp:322-324
+  if(PublicOnly && ! isPublic(D->getAccess(), D->getLinkageInternal())){
+    return "";
+  }
----------------
Since this is the same for Record/Function/Enum, can we move this to `populateSymbolInfo()`?

Also, elide braces on single-line ifs.


https://reviews.llvm.org/D48395





More information about the cfe-commits mailing list