Skip to content

Commit b34e2d7

Browse files
authored
Merge pull request #81306 from gottesmm/pr-b6ba1a771d90007a5ee6da3e4dc657bfef32b320
[swift-settings] Now that we aren't using it immediately, remove it from tree.
2 parents 5137f6e + 9d59dbe commit b34e2d7

29 files changed

+2
-557
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
@@ -3051,8 +3051,6 @@ enum ENUM_EXTENSIBILITY_ATTR(open) BridgedMacroDefinitionKind : size_t {
30513051
BridgedBuiltinExternalMacro,
30523052
/// The builtin definition for the "isolation" macro.
30533053
BridgedBuiltinIsolationMacro,
3054-
/// The builtin definition for the "SwiftSetting" macro.
3055-
BridgedBuiltinSwiftSettingsMacro,
30563054
};
30573055

30583056
struct BridgedASTType {

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8717,20 +8717,5 @@ ERROR(extensible_attr_on_internal_type,none,
87178717
ERROR(pre_enum_extensibility_without_extensible,none,
87188718
"%0 can only be used together with '@extensible' attribute", (DeclAttribute))
87198719
8720-
//===----------------------------------------------------------------------===//
8721-
// MARK: SwiftSettings
8722-
//===----------------------------------------------------------------------===//
8723-
8724-
ERROR(swift_settings_invalid_setting, none,
8725-
"Unrecognized setting passed to #SwiftSettings", ())
8726-
8727-
ERROR(swift_settings_must_be_top_level, none,
8728-
"#SwiftSettings can only be invoked as a top level declaration", ())
8729-
8730-
ERROR(swift_settings_duplicate_setting, none,
8731-
"duplicate setting passed to #SwiftSettings", ())
8732-
NOTE(swift_settings_duplicate_setting_original_loc, none,
8733-
"setting originally passed here", ())
8734-
87358720
#define UNDEFINE_DIAGNOSTIC_MACROS
87368721
#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
@@ -54,15 +54,6 @@ enum class RestrictedImportKind {
5454
/// Import that limits the access level of imported entities.
5555
using ImportAccessLevel = std::optional<AttributedImport<ImportedModule>>;
5656

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

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

include/swift/AST/TypeCheckRequests.h

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

5335-
class SourceFileLangOptionsRequest
5336-
: public SimpleRequest<SourceFileLangOptionsRequest,
5337-
SourceFileLangOptions(SourceFile *),
5338-
RequestFlags::Cached> {
5339-
5340-
public:
5341-
using SimpleRequest::SimpleRequest;
5342-
5343-
private:
5344-
friend SimpleRequest;
5345-
5346-
SourceFileLangOptions evaluate(Evaluator &evaluator,
5347-
SourceFile *sourceFile) const;
5348-
5349-
public:
5350-
bool isCached() const { return true; }
5351-
std::optional<SourceFileLangOptions> getCachedResult() const;
5352-
void cacheResult(SourceFileLangOptions value) const;
5353-
};
5354-
53555335
#define SWIFT_TYPEID_ZONE TypeChecker
53565336
#define SWIFT_TYPEID_HEADER "swift/AST/TypeCheckerTypeIDZone.def"
53575337
#include "swift/Basic/DefineTypeIDZone.h"

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,3 @@ SWIFT_REQUEST(TypeChecker, SemanticAvailabilitySpecRequest,
629629
std::optional<SemanticAvailabilitySpec>
630630
(const AvailabilitySpec *, const DeclContext *),
631631
SeparatelyCached, NoLocationInfo)
632-
633-
SWIFT_REQUEST(TypeChecker, SourceFileLangOptionsRequest,
634-
SourceFileLangOptions (SourceFile *), Cached, NoLocationInfo)

include/swift/Basic/Features.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,6 @@ SUPPRESSIBLE_EXPERIMENTAL_FEATURE(ABIAttribute, true)
489489
/// Allow custom availability domains to be defined and referenced.
490490
EXPERIMENTAL_FEATURE(CustomAvailability, true)
491491

492-
/// Allow SwiftSettings
493-
EXPERIMENTAL_FEATURE(SwiftSettings, false)
494-
495492
/// Syntax sugar features for concurrency.
496493
EXPERIMENTAL_FEATURE(ConcurrencySyntaxSugar, true)
497494

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4808,9 +4808,6 @@ void PrintAST::visitMacroDecl(MacroDecl *decl) {
48084808
case BuiltinMacroKind::IsolationMacro:
48094809
Printer << "IsolationMacro";
48104810
break;
4811-
case BuiltinMacroKind::SwiftSettingsMacro:
4812-
Printer << "SwiftSettingsMacro";
4813-
break;
48144811
}
48154812
break;
48164813

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -451,14 +451,6 @@ UNINTERESTING_FEATURE(SuppressCXXForeignReferenceTypeInitializers)
451451
UNINTERESTING_FEATURE(CoroutineAccessorsUnwindOnCallerError)
452452
UNINTERESTING_FEATURE(AllowRuntimeSymbolDeclarations)
453453

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

0 commit comments

Comments
 (0)