This is an archive of the discontinued LLVM Phabricator instance.

[clang] Rename Decl::isHidden() to isUnconditionallyVisible()
ClosedPublic

Authored by mboehme on Jun 8 2020, 7:04 AM.

Details

Summary

Also invert the sense of the return value.

As pointed out by the FIXME that this change resolves, isHidden() wasn't a very accurate name for this function.

I haven't yet changed any of the strings that are output in ASTDumper.cpp / JSONNodeDumper.cpp / TextNodeDumper.cpp in response to whether isHidden() is set because

a) I'm not sure whether it's actually desired to change these strings (would appreciate feedback on this), and

b) In any case, I'd like to get this pure rename out of the way first, without any changes to tests. Changing the strings that are output in the various ...Dumper.cpp files will require changes to quite a few tests, and I'd like to make those in a separate change.

Diff Detail

Event Timeline

mboehme created this revision.Jun 8 2020, 7:04 AM
rsmith accepted this revision.Jun 11 2020, 11:41 AM

I think renaming the flag in the AST dump output would be a good idea, though it'll be a lot of churn in the tests. I would prefer that we continue to dump a marker only if the declaration is not unconditionally visible rather than reversing the sense of the flag in the dump output. Maybe we should dump the ModuleOwnershipKind in general, not only an indicator of whether it's Visible or something else?

This revision is now accepted and ready to land.Jun 11 2020, 11:41 AM

I think renaming the flag in the AST dump output would be a good idea, though it'll be a lot of churn in the tests. I would prefer that we continue to dump a marker only if the declaration is not unconditionally visible rather than reversing the sense of the flag in the dump output.

Agree -- I had tried that experimentally, but it does cause a lot of noise in the output.

Maybe we should dump the ModuleOwnershipKind in general, not only an indicator of whether it's Visible or something else?

I like this -- though would we then always dump the ModuleOwnershipKind (i.e. causing a lot of churn, as discussed above) or only if it's VisibleWhenImported or ModulePrivate (i.e. not unconditionally visible)?

This revision was automatically updated to reflect the committed changes.

Maybe we should dump the ModuleOwnershipKind in general, not only an indicator of whether it's Visible or something else?

I like this -- though would we then always dump the ModuleOwnershipKind (i.e. causing a lot of churn, as discussed above) or only if it's VisibleWhenImported or ModulePrivate (i.e. not unconditionally visible)?

I think only producing output for the "non-default" state (not Visible) would be best, both too minimize the test churn and to keep the dump smaller and simpler in simple cases.