Skip to content

Commit 322a376

Browse files
authored
Merge pull request #81334 from gottesmm/release/6.2-rdar150695113
[6.2][swift-settings] Now that we aren't using it immediately, remove it from tree.
2 parents 2cc9fc6 + 741e667 commit 322a376

30 files changed

+3
-558
lines changed

Runtimes/Core/core/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ add_library(swiftCore
188188
StringWordBreaking.swift
189189
Substring.swift
190190
SwiftNativeNSArray.swift
191-
SwiftSettings.swift
192191
TemporaryAllocation.swift
193192
ThreadLocalStorage.swift
194193
UIntBuffer.swift

include/swift/AST/ASTBridging.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,8 +3049,6 @@ enum ENUM_EXTENSIBILITY_ATTR(open) BridgedMacroDefinitionKind : size_t {
30493049
BridgedBuiltinExternalMacro,
30503050
/// The builtin definition for the "isolation" macro.
30513051
BridgedBuiltinIsolationMacro,
3052-
/// The builtin definition for the "SwiftSetting" macro.
3053-
BridgedBuiltinSwiftSettingsMacro,
30543052
};
30553053

30563054
struct BridgedASTType {

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8650,20 +8650,5 @@ GROUPED_WARNING(
86508650
"behavior",
86518651
(StringRef, DeclAttribute))
86528652
8653-
//===----------------------------------------------------------------------===//
8654-
// MARK: SwiftSettings
8655-
//===----------------------------------------------------------------------===//
8656-
8657-
ERROR(swift_settings_invalid_setting, none,
8658-
"Unrecognized setting passed to #SwiftSettings", ())
8659-
8660-
ERROR(swift_settings_must_be_top_level, none,
8661-
"#SwiftSettings can only be invoked as a top level declaration", ())
8662-
8663-
ERROR(swift_settings_duplicate_setting, none,
8664-
"duplicate setting passed to #SwiftSettings", ())
8665-
NOTE(swift_settings_duplicate_setting_original_loc, none,
8666-
"setting originally passed here", ())
8667-
86688653
#define UNDEFINE_DIAGNOSTIC_MACROS
86698654
#include "DefineDiagnosticMacros.h"

include/swift/AST/KnownStdlibTypes.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ KNOWN_STDLIB_TYPE_DECL(Result, NominalTypeDecl, 2)
101101

102102
KNOWN_STDLIB_TYPE_DECL(InlineArray, NominalTypeDecl, 2)
103103

104-
KNOWN_STDLIB_TYPE_DECL(SwiftSetting, NominalTypeDecl, 0)
105-
106104
KNOWN_STDLIB_TYPE_DECL(MutableSpan, NominalTypeDecl, 1)
107105

108106
#undef KNOWN_STDLIB_TYPE_DECL

include/swift/AST/MacroDefinition.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ enum class BuiltinMacroKind : uint8_t {
7777
ExternalMacro,
7878
/// #isolation, which produces the isolation of the current context
7979
IsolationMacro,
80-
/// #SwiftSettings, which allows for the user to set a compiler setting at
81-
/// the file level
82-
SwiftSettingsMacro,
8380
};
8481

8582
/// A single replacement

include/swift/AST/SourceFile.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,6 @@ enum class RestrictedImportKind {
5353
/// Import that limits the access level of imported entities.
5454
using ImportAccessLevel = std::optional<AttributedImport<ImportedModule>>;
5555

56-
/// Language options only for use with a specific SourceFile.
57-
///
58-
/// Vended by SourceFile::getLanguageOptions().
59-
struct SourceFileLangOptions {
60-
/// If unset, no value was provided. If a Type, that type is the type of the
61-
/// isolation. If set to an empty type, nil was specified explicitly.
62-
std::optional<Type> defaultIsolation;
63-
};
64-
6556
/// A file containing Swift source code.
6657
///
6758
/// This is a .swift or .sil file (or a virtual file, such as the contents of
@@ -571,9 +562,6 @@ class SourceFile final : public FileUnit {
571562
ObjCSelector selector,
572563
SmallVectorImpl<AbstractFunctionDecl *> &results) const override;
573564

574-
/// File level language options.
575-
SourceFileLangOptions getLanguageOptions() const;
576-
577565
protected:
578566
virtual void
579567
lookupOperatorDirect(Identifier name, OperatorFixity fixity,

include/swift/AST/TypeCheckRequests.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5313,26 +5313,6 @@ class SemanticAvailabilitySpecRequest
53135313
void cacheResult(std::optional<SemanticAvailabilitySpec> value) const;
53145314
};
53155315

5316-
class SourceFileLangOptionsRequest
5317-
: public SimpleRequest<SourceFileLangOptionsRequest,
5318-
SourceFileLangOptions(SourceFile *),
5319-
RequestFlags::Cached> {
5320-
5321-
public:
5322-
using SimpleRequest::SimpleRequest;
5323-
5324-
private:
5325-
friend SimpleRequest;
5326-
5327-
SourceFileLangOptions evaluate(Evaluator &evaluator,
5328-
SourceFile *sourceFile) const;
5329-
5330-
public:
5331-
bool isCached() const { return true; }
5332-
std::optional<SourceFileLangOptions> getCachedResult() const;
5333-
void cacheResult(SourceFileLangOptions value) const;
5334-
};
5335-
53365316
#define SWIFT_TYPEID_ZONE TypeChecker
53375317
#define SWIFT_TYPEID_HEADER "swift/AST/TypeCheckerTypeIDZone.def"
53385318
#include "swift/Basic/DefineTypeIDZone.h"

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,3 @@ SWIFT_REQUEST(TypeChecker, SemanticAvailabilitySpecRequest,
626626
std::optional<SemanticAvailabilitySpec>
627627
(const AvailabilitySpec *, const DeclContext *),
628628
SeparatelyCached, NoLocationInfo)
629-
630-
SWIFT_REQUEST(TypeChecker, SourceFileLangOptionsRequest,
631-
SourceFileLangOptions (SourceFile *), Cached, NoLocationInfo)

include/swift/Basic/Features.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,6 @@ EXPERIMENTAL_FEATURE(CustomAvailability, true)
499499
/// is resilient or not.
500500
EXPERIMENTAL_FEATURE(ExtensibleEnums, true)
501501

502-
/// Allow SwiftSettings
503-
EXPERIMENTAL_FEATURE(SwiftSettings, false)
504-
505502
/// Syntax sugar features for concurrency.
506503
EXPERIMENTAL_FEATURE(ConcurrencySyntaxSugar, true)
507504

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4797,9 +4797,6 @@ void PrintAST::visitMacroDecl(MacroDecl *decl) {
47974797
case BuiltinMacroKind::IsolationMacro:
47984798
Printer << "IsolationMacro";
47994799
break;
4800-
case BuiltinMacroKind::SwiftSettingsMacro:
4801-
Printer << "SwiftSettingsMacro";
4802-
break;
48034800
}
48044801
break;
48054802

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,14 +449,6 @@ UNINTERESTING_FEATURE(CoroutineAccessorsUnwindOnCallerError)
449449
UNINTERESTING_FEATURE(AllowRuntimeSymbolDeclarations)
450450
UNINTERESTING_FEATURE(CopyBlockOptimization)
451451

452-
static bool usesFeatureSwiftSettings(const Decl *decl) {
453-
// We just need to guard `#SwiftSettings`.
454-
auto *macro = dyn_cast<MacroDecl>(decl);
455-
return macro && macro->isStdlibDecl() &&
456-
macro->getMacroRoles().contains(MacroRole::Declaration) &&
457-
macro->getBaseIdentifier().is("SwiftSettings");
458-
}
459-
460452
bool swift::usesFeatureIsolatedDeinit(const Decl *decl) {
461453
if (auto cd = dyn_cast<ClassDecl>(decl)) {
462454
return cd->getFormalAccess() == AccessLevel::Open &&

0 commit comments

Comments
 (0)