This patch implements clang_getCursorVisibility which provides access to NamedDecl::getVisibility. It's been very useful for me when generating bindings.
Details
Diff Detail
Event Timeline
Isn't r246931 what you're looking for?
Index: expose visibility attribute
Expose the previously unexposed visibility attribute via the python and C
bindings.
Can't you use/improve that API instead?
Visibility can be set via command line args without any attributes in the AST, so I don't think that's sufficient.
Sergey, I think you raised concerns whether this is necessary. What are your thoughts?
Well, I think it's ok then. Still there is no test for visibility set from command line case.
Also adding comment to clang_getCursorVisibility explaining that it also works with visibility set from command line would be very useful.
test/Index/symbol-visibility.c | ||
---|---|---|
9 | Are you sure that this is correct? |
test/Index/symbol-visibility.c | ||
---|---|---|
9 | Not sure about this. For most purposes, default and hidden is all you need so I don't think there's much lost by cutting this part of this test. I was on the fence about whether to test for protected. |
This removes the test for protected visibility and improves documentation for clang_getCursorVisibility.
Are you sure that this is correct?
Looking at r246931, it seems like the protected visibility is not supported on all platforms.