Skip to content

Commit 96a0d0e

Browse files
committed
Rename various IncludeUsableFromInlineAndInlineable to IncludeUsableFromInline
`@inlinable` implies `@usableFromInline`. NFC intended.
1 parent db8402f commit 96a0d0e

12 files changed

+19
-19
lines changed

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2188,7 +2188,7 @@ class ValueDecl : public Decl {
21882188
/// the default implementations are not visible to name lookup.
21892189
bool isAccessibleFrom(const DeclContext *DC,
21902190
bool forConformance = false,
2191-
bool includeInlineable = false) const;
2191+
bool allowUsableFromInline = false) const;
21922192

21932193
/// Returns whether this declaration should be treated as \c open from
21942194
/// \p useDC. This is very similar to #getFormalAccess, but takes

include/swift/AST/LookupKinds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ enum NLOptions : unsigned {
5151
NL_IncludeAttributeImplements = 1 << 5,
5252

5353
// Include @usableFromInline and @inlinable
54-
NL_IncludeUsableFromInlineAndInlineable = 1 << 6,
54+
NL_IncludeUsableFromInline = 1 << 6,
5555

5656
/// The default set of options used for qualified name lookup.
5757
///

include/swift/AST/ModuleNameLookup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void simple_display(llvm::raw_ostream &out, ResolutionKind kind);
5757
/// being performed, for checking access. This must be either a
5858
/// FileUnit or a Module.
5959
/// \param options name lookup options. Currently only used to communicate the
60-
/// NL_IncludeUsableFromInlineAndInlineable option.
60+
/// NL_IncludeUsableFromInline option.
6161
void lookupInModule(const DeclContext *moduleOrFile,
6262
DeclName name, SmallVectorImpl<ValueDecl *> &decls,
6363
NLKind lookupKind, ResolutionKind resolutionKind,

include/swift/AST/NameLookup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ enum class UnqualifiedLookupFlags {
227227
IncludeOuterResults = 1 << 4,
228228
// This lookup should include results that are @inlinable or
229229
// @usableFromInline.
230-
IncludeInlineableAndUsableFromInline = 1 << 5,
230+
IncludeUsableFromInline = 1 << 5,
231231
};
232232

233233
using UnqualifiedLookupOptions = OptionSet<UnqualifiedLookupFlags>;

lib/AST/Decl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3394,8 +3394,8 @@ static bool checkAccess(const DeclContext *useDC, const ValueDecl *VD,
33943394

33953395
bool ValueDecl::isAccessibleFrom(const DeclContext *useDC,
33963396
bool forConformance,
3397-
bool includeInlineable) const {
3398-
return checkAccess(useDC, this, forConformance, includeInlineable,
3397+
bool allowUsableFromInline) const {
3398+
return checkAccess(useDC, this, forConformance, allowUsableFromInline,
33993399
[&]() { return getFormalAccess(); });
34003400
}
34013401

lib/AST/ModuleNameLookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void ModuleNameLookup<LookupStrategy>::lookupInModule(
145145

146146
const size_t initialCount = decls.size();
147147
size_t currentCount = decls.size();
148-
bool includeInlineable = options & NL_IncludeUsableFromInlineAndInlineable;
148+
bool includeInlineable = options & NL_IncludeUsableFromInline;
149149

150150
auto updateNewDecls = [&](const DeclContext *moduleScopeContext) {
151151
if (decls.size() == currentCount)

lib/AST/NameLookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ static bool isAcceptableLookupResult(const DeclContext *dc,
15021502
// Check access.
15031503
if (!(options & NL_IgnoreAccessControl) &&
15041504
!dc->getASTContext().isAccessControlDisabled()) {
1505-
bool allowInlinable = options & NL_IncludeUsableFromInlineAndInlineable;
1505+
bool allowInlinable = options & NL_IncludeUsableFromInline;
15061506
return decl->isAccessibleFrom(dc, /*forConformance*/ false, allowInlinable);
15071507
}
15081508

lib/AST/UnqualifiedLookup.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ void UnqualifiedLookupFactory::addImportedResults(const DeclContext *const dc) {
384384
auto resolutionKind = isOriginallyTypeLookup ? ResolutionKind::TypesOnly
385385
: ResolutionKind::Overloadable;
386386
auto nlOptions = NL_UnqualifiedDefault;
387-
if (options.contains(Flags::IncludeInlineableAndUsableFromInline))
388-
nlOptions |= NL_IncludeUsableFromInlineAndInlineable;
387+
if (options.contains(Flags::IncludeUsableFromInline))
388+
nlOptions |= NL_IncludeUsableFromInline;
389389
lookupInModule(dc, Name.getFullName(), CurModuleResults,
390390
NLKind::UnqualifiedLookup, resolutionKind, dc, nlOptions);
391391

@@ -841,4 +841,4 @@ ValueDecl *ASTScope::lookupSingleLocalDecl(SourceFile *sf, DeclName name,
841841
if (result.size() != 1)
842842
return nullptr;
843843
return result[0];
844-
}
844+
}

lib/Sema/TypeCheckAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2465,7 +2465,7 @@ static void lookupReplacedDecl(DeclNameRef replacedDeclName,
24652465

24662466
auto options = NL_QualifiedDefault;
24672467
if (declCtxt->isInSpecializeExtensionContext())
2468-
options |= NL_IncludeUsableFromInlineAndInlineable;
2468+
options |= NL_IncludeUsableFromInline;
24692469

24702470
if (typeCtx)
24712471
moduleScopeCtxt->lookupQualified({typeCtx}, replacedDeclName, options,

lib/Sema/TypeCheckNameLookup.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ convertToUnqualifiedLookupOptions(NameLookupOptions options) {
211211
newOptions |= UnqualifiedLookupFlags::IgnoreAccessControl;
212212
if (options.contains(NameLookupFlags::IncludeOuterResults))
213213
newOptions |= UnqualifiedLookupFlags::IncludeOuterResults;
214-
if (options.contains(NameLookupFlags::IncludeInlineableAndUsableFromInline))
215-
newOptions |= UnqualifiedLookupFlags::IncludeInlineableAndUsableFromInline;
214+
if (options.contains(NameLookupFlags::IncludeUsableFromInline))
215+
newOptions |= UnqualifiedLookupFlags::IncludeUsableFromInline;
216216

217217
return newOptions;
218218
}
@@ -388,8 +388,8 @@ LookupTypeResult TypeChecker::lookupMemberType(DeclContext *dc,
388388

389389
if (options.contains(NameLookupFlags::IgnoreAccessControl))
390390
subOptions |= NL_IgnoreAccessControl;
391-
if (options.contains(NameLookupFlags::IncludeInlineableAndUsableFromInline))
392-
subOptions |= NL_IncludeUsableFromInlineAndInlineable;
391+
if (options.contains(NameLookupFlags::IncludeUsableFromInline))
392+
subOptions |= NL_IncludeUsableFromInline;
393393

394394
// Make sure we've resolved implicit members, if we need them.
395395
if (auto *current = type->getAnyNominal()) {

0 commit comments

Comments
 (0)