Lines Matching refs:Visibility
58 // Visibility rules aren't rigorously externally specified, but here
61 // 1. An explicit visibility attribute is generally a direct expression
63 // visibility attribute applies. If no visibility attribute applies,
64 // global visibility settings are considered.
67 // an explicit visibility attribute is just a default rule, and
68 // visibility can be decreased by the visibility of template
70 // explicit specialization or instantiation causes all the visibility
73 // 3. A variable that does not otherwise have explicit visibility can
74 // be restricted by the visibility of its type.
76 // 4. A visibility restriction is explicit if it comes from an
77 // attribute (or something like it), not a global visibility setting.
78 // When emitting a reference to an external symbol, visibility
81 // 5. When computing the visibility of a non-type, including a
82 // non-type member of a class, only non-type visibility restrictions
83 // are considered: the 'visibility' attribute, global value-visibility
86 // 6. When computing the visibility of a type, including a type member
87 // of a class, only type visibility restrictions are considered:
88 // the 'type_visibility' attribute and global type-visibility settings.
89 // However, a 'visibility' attribute counts as a 'type_visibility'
92 // The visibility of a "secondary" entity, like a template argument,
94 // primary entity for which we are computing visibility. For example,
95 // the visibility of a specialization of either of these templates:
98 // is restricted according to the type visibility of the argument 'T',
99 // the type visibility of 'bool(&)(T,X)', and the value visibility of
108 /// always the same, but different things can change how visibility is
112 /// Visibility may be restricted by type visibility settings and
113 /// the visibility of template arguments.
117 /// Visibility may be restricted by value visibility settings and
118 /// the visibility of template arguments.
122 /// some sort of explicit visibility. Visibility may only be
123 /// restricted by the visibility of template arguments.
127 /// that already has some sort of explicit visibility. Visibility
128 /// may only be restricted by the visibility of template arguments.
137 /// visibility settings from attributes and the like?
143 /// that records that it already has explicit visibility.
156 static Optional<Visibility> getExplicitVisibility(const NamedDecl *D,
159 "asking for explicit visibility when we shouldn't be");
164 /// visibility computation?
190 /// Given a visibility attribute, return the explicit visibility
193 static Visibility getVisibilityFromAttr(const T *attr) {
202 llvm_unreachable("bad visibility kind");
205 /// Return the explicit visibility of the given declaration.
206 static Optional<Visibility> getVisibilityOf(const NamedDecl *D,
208 // If we're ultimately computing the visibility of a type, look for
209 // a 'type_visibility' attribute before looking for 'visibility'.
216 // If this declaration has an explicit visibility attribute, use it.
222 // implies visibility(default).
240 /// template parameter list. For visibility purposes, template
248 // contribute to visibility, pack or not.
296 /// getLVForDecl - Get the linkage and visibility for the given declaration.
315 /// want to honor the visibility of template arguments in the same way.
367 // Include visibility from the template parameters and arguments
369 // with direct explicit visibility. (Implicit instantiations won't
377 /// Merge in template-related linkage and visibility for the given
403 /// Does the given declaration have a direct visibility attribute
421 llvm_unreachable("bad visibility computation kind");
424 /// Should we consider visibility associated with the template
429 // Include visibility from the template parameters and arguments
431 // with direct explicit visibility (and note that implicit
435 // for an explicit specialization when computing the visibility of a
436 // member thereof with explicit visibility.
442 // explicit visibility attribute, that must directly express the
448 // visibility restrictions.
460 /// Merge in template-related linkage and visibility for the given
468 // visibility if we're only considering template arguments.
477 // template-argument visibility if we've got an explicit
478 // instantiation with a visibility attribute.
486 /// Should we consider visibility associated with the template
493 // Include visibility from the template parameters and arguments
495 // with direct explicit visibility (and note that implicit
501 // declaration. As such, if it has an explicit visibility attribute,
511 /// Merge in template-related linkage and visibility for the given
520 // visibility if we're only considering template arguments.
529 // template-argument visibility if we've got an explicit
530 // instantiation with a visibility attribute.
657 if (Optional<Visibility> Vis = getExplicitVisibility(D, computation)) {
660 // If we're declared in a namespace with a visibility attribute,
661 // use that namespace's visibility, and it still counts as explicit.
667 if (Optional<Visibility> Vis = getExplicitVisibility(ND, computation)) {
674 // Add in global settings if the above didn't give us direct visibility.
676 // Use global type/value visibility as appropriate.
677 Visibility globalVisibility;
686 // If we're paying attention to global visibility, apply
687 // -finline-visibility-hidden if this is an inline method.
733 // C99 6.2.2p4 and propagating the visibility attribute, so we don't have
754 // merging storage classes and visibility attributes, so we don't have to
840 // If we ended up with non-external linkage, visibility should
857 // linkage and visibility of a template specialization, we might hit
870 // If we have an explicit visibility attribute, merge that in.
872 if (Optional<Visibility> Vis = getExplicitVisibility(D, computation))
874 // If we're paying attention to global visibility, apply
875 // -finline-visibility-hidden if this is an inline method.
878 // the class visibility.
883 // If this class member has an explicit visibility attribute, the only
884 // thing that can change its visibility is the template arguments, so
901 // we need to completely ignore the visibility from it.
958 // type's visibility unless it's a definition.
989 // an explicit attribute, ignore visibility from the parent.
992 // optimization: hasDVA() is true only with explicit visibility.
1031 // We don't care about visibility here, so ask for the cheapest
1032 // possible visibility analysis.
1042 static Optional<Visibility>
1049 if (Optional<Visibility> V = getVisibilityOf(ND, kind))
1053 // and the corresponding decl has explicit visibility, use that.
1060 // If there wasn't explicit visibility there, and this is a
1061 // specialization of a class template, check for visibility
1090 // explicit visibility attribute, use that.
1097 // and the corresponding decl has explicit visibility, use that.
1105 // The visibility of a template is stored in the templated decl.
1112 Optional<Visibility>
1119 // This lambda has its linkage/visibility determined by its owner.
1146 if (Optional<Visibility> Vis =
1152 // merging storage classes and visibility attributes, so we don't have to
1167 if (Optional<Visibility> Vis = getExplicitVisibility(Var, computation))
1289 // This lambda has its linkage/visibility determined:
1559 // FIXME: Is this true even if they have different module visibility?
1593 // different visibility. Any attempt to use the name will result in an