[cfe-dev] Determine field or member function visibility

Kirill Bobyrev via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 28 06:55:33 PDT 2016


Hi,

There are actually AST Matchers which can help you with that. You can also look at the implementation to see how it’s done.

http://clang.llvm.org/docs/LibASTMatchersReference.html <http://clang.llvm.org/docs/LibASTMatchersReference.html> -> isPrivate, isProtected, isPublic.

What you’re actually looking for is Decl->getAccess().

—
Kirill Bobyrev

> On 28 Jul 2016, at 15:46, David Come via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> Hi,
> 
> 
> I'm using libtooling and I would like to know if a CXXMethodDecl or FieldDecl is public/private/protected.
> 
> This sounds pretty simple but I can't find in the doc any kind of isPublic/isPrivate/isProtected. There is a getVisibility but it seems related to the linker.
> 
> 
> 
> What am I missing ?
> 
> 
> 
> Thanks,
> 
> David.
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160728/ef796537/attachment.html>


More information about the cfe-dev mailing list