[PATCH] D48395: Added PublicOnly flag

Annie Cherkaev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 3 11:16:15 PDT 2018

anniecherk marked 11 inline comments as done.
anniecherk added inline comments.

Comment at: clang-tools-extra/clang-doc/Serialize.cpp:322-324
+  if(PublicOnly && ! isPublic(D->getAccess(), D->getLinkageInternal())){
+    return "";
+  }
juliehockett wrote:
> Since this is the same for Record/Function/Enum, can we move this to `populateSymbolInfo()`?
> Also, elide braces on single-line ifs.
I don't see a good way to put it into populateSymbolInfo because if the condition passes then the emitInfo method needs to bail out and I don't see a clean way to do that if the check is in populateSymbolInfo.  A clunky way to do this would be to either have populateSymbolInfo set a flag that emitInfo checks or emitInfo can assume that populateSymbolInfo bailed if all the info is unpopulated, but that seems like a worse way to do it. Am I missing something? 

I can refactor the condition into a function if that would be better for understandability / maintainability.


More information about the cfe-commits mailing list