Home | History | Annotate | Download | only in AST

Lines Matching refs:Visibility

57 // Visibility rules aren't rigorously externally specified, but here
60 // 1. An explicit visibility attribute is generally a direct expression
62 // visibility attribute applies. If no visibility attribute applies,
63 // global visibility settings are considered.
66 // an explicit visibility attribute is just a default rule, and
67 // visibility can be decreased by the visibility of template
69 // explicit specialization or instantiation causes all the visibility
72 // 3. A variable that does not otherwise have explicit visibility can
73 // be restricted by the visibility of its type.
75 // 4. A visibility restriction is explicit if it comes from an
76 // attribute (or something like it), not a global visibility setting.
77 // When emitting a reference to an external symbol, visibility
80 // 5. When computing the visibility of a non-type, including a
81 // non-type member of a class, only non-type visibility restrictions
82 // are considered: the 'visibility' attribute, global value-visibility
85 // 6. When computing the visibility of a type, including a type member
86 // of a class, only type visibility restrictions are considered:
87 // the 'type_visibility' attribute and global type-visibility settings.
88 // However, a 'visibility' attribute counts as a 'type_visibility'
91 // The visibility of a "secondary" entity, like a template argument,
93 // primary entity for which we are computing visibility. For example,
94 // the visibility of a specialization of either of these templates:
97 // is restricted according to the type visibility of the argument 'T',
98 // the type visibility of 'bool(&)(T,X)', and the value visibility of
107 /// always the same, but different things can change how visibility is
111 /// Visibility may be restricted by type visibility settings and
112 /// the visibility of template arguments.
116 /// Visibility may be restricted by value visibility settings and
117 /// the visibility of template arguments.
121 /// some sort of explicit visibility. Visibility may only be
122 /// restricted by the visibility of template arguments.
126 /// that already has some sort of explicit visibility. Visibility
127 /// may only be restricted by the visibility of template arguments.
136 /// visibility settings from attributes and the like?
142 /// that records that it already has explicit visibility.
155 static Optional<Visibility> getExplicitVisibility(const NamedDecl *D,
158 "asking for explicit visibility when we shouldn't be");
163 /// visibility computation?
189 /// Given a visibility attribute, return the explicit visibility
192 static Visibility getVisibilityFromAttr(const T *attr) {
201 llvm_unreachable("bad visibility kind");
204 /// Return the explicit visibility of the given declaration.
205 static Optional<Visibility> getVisibilityOf(const NamedDecl *D,
207 // If we're ultimately computing the visibility of a type, look for
208 // a 'type_visibility' attribute before looking for 'visibility'.
215 // If this declaration has an explicit visibility attribute, use it.
221 // implies visibility(default).
239 /// template parameter list. For visibility purposes, template
247 // contribute to visibility, pack or not.
295 /// getLVForDecl - Get the linkage and visibility for the given declaration.
314 /// want to honor the visibility of template arguments in the same way.
366 // Include visibility from the template parameters and arguments
368 // with direct explicit visibility. (Implicit instantiations won't
376 /// Merge in template-related linkage and visibility for the given
402 /// Does the given declaration have a direct visibility attribute
420 llvm_unreachable("bad visibility computation kind");
423 /// Should we consider visibility associated with the template
428 // Include visibility from the template parameters and arguments
430 // with direct explicit visibility (and note that implicit
434 // for an explicit specialization when computing the visibility of a
435 // member thereof with explicit visibility.
441 // explicit visibility attribute, that must directly express the
447 // visibility restrictions.
459 /// Merge in template-related linkage and visibility for the given
467 // visibility if we're only considering template arguments.
476 // template-argument visibility if we've got an explicit
477 // instantiation with a visibility attribute.
485 /// Should we consider visibility associated with the template
492 // Include visibility from the template parameters and arguments
494 // with direct explicit visibility (and note that implicit
500 // declaration. As such, if it has an explicit visibility attribute,
510 /// Merge in template-related linkage and visibility for the given
519 // visibility if we're only considering template arguments.
528 // template-argument visibility if we've got an explicit
529 // instantiation with a visibility attribute.
654 if (Optional<Visibility> Vis = getExplicitVisibility(D, computation)) {
657 // If we're declared in a namespace with a visibility attribute,
658 // use that namespace's visibility, and it still counts as explicit.
664 if (Optional<Visibility> Vis = getExplicitVisibility(ND, computation)) {
671 // Add in global settings if the above didn't give us direct visibility.
673 // Use global type/value visibility as appropriate.
674 Visibility globalVisibility;
683 // If we're paying attention to global visibility, apply
684 // -finline-visibility-hidden if this is an inline method.
730 // C99 6.2.2p4 and propagating the visibility attribute, so we don't have
751 // merging storage classes and visibility attributes, so we don't have to
837 // If we ended up with non-external linkage, visibility should
854 // linkage and visibility of a template specialization, we might hit
867 // If we have an explicit visibility attribute, merge that in.
869 if (Optional<Visibility> Vis = getExplicitVisibility(D, computation))
871 // If we're paying attention to global visibility, apply
872 // -finline-visibility-hidden if this is an inline method.
875 // the class visibility.
880 // If this class member has an explicit visibility attribute, the only
881 // thing that can change its visibility is the template arguments, so
898 // we need to completely ignore the visibility from it.
955 // type's visibility unless it's a definition.
986 // an explicit attribute, ignore visibility from the parent.
989 // optimization: hasDVA() is true only with explicit visibility.
1028 // We don't care about visibility here, so ask for the cheapest
1029 // possible visibility analysis.
1039 static Optional<Visibility>
1046 if (Optional<Visibility> V = getVisibilityOf(ND, kind))
1050 // and the corresponding decl has explicit visibility, use that.
1057 // If there wasn't explicit visibility there, and this is a
1058 // specialization of a class template, check for visibility
1087 // explicit visibility attribute, use that.
1094 // and the corresponding decl has explicit visibility, use that.
1102 // The visibility of a template is stored in the templated decl.
1109 Optional<Visibility>
1116 // This lambda has its linkage/visibility determined by its owner.
1143 if (Optional<Visibility> Vis =
1149 // merging storage classes and visibility attributes, so we don't have to
1164 if (Optional<Visibility> Vis = getExplicitVisibility(Var, computation))
1286 // 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