Skip to content

Commit e3ca041

Browse files
Merge pull request #1080 from swiftwasm/maxd/revert-host-build
Revert host toolchain build change, merge master
2 parents 627df41 + 2993732 commit e3ca041

File tree

136 files changed

+3303
-1251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+3303
-1251
lines changed

include/swift/AST/ASTContext.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -748,11 +748,13 @@ class ASTContext final {
748748
/// \param methods The list of @objc methods in this class that have this
749749
/// selector and are instance/class methods as requested. This list will be
750750
/// extended with any methods found in subsequent generations.
751-
void loadObjCMethods(ClassDecl *classDecl,
752-
ObjCSelector selector,
753-
bool isInstanceMethod,
754-
unsigned previousGeneration,
755-
llvm::TinyPtrVector<AbstractFunctionDecl *> &methods);
751+
///
752+
/// \param swiftOnly If true, only loads methods from imported Swift modules,
753+
/// skipping the Clang importer.
754+
void loadObjCMethods(ClassDecl *classDecl, ObjCSelector selector,
755+
bool isInstanceMethod, unsigned previousGeneration,
756+
llvm::TinyPtrVector<AbstractFunctionDecl *> &methods,
757+
bool swiftOnly = false);
756758

757759
/// Load derivative function configurations for the given
758760
/// AbstractFunctionDecl.

include/swift/AST/Decl.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4117,8 +4117,8 @@ class ClassDecl final : public NominalTypeDecl {
41174117
///
41184118
/// \param isInstance Whether we are looking for an instance method
41194119
/// (vs. a class method).
4120-
MutableArrayRef<AbstractFunctionDecl *> lookupDirect(ObjCSelector selector,
4121-
bool isInstance);
4120+
TinyPtrVector<AbstractFunctionDecl *> lookupDirect(ObjCSelector selector,
4121+
bool isInstance);
41224122

41234123
/// Record the presence of an @objc method with the given selector.
41244124
void recordObjCMethod(AbstractFunctionDecl *method, ObjCSelector selector);
@@ -5232,6 +5232,12 @@ class VarDecl : public AbstractStorageDecl {
52325232
Optional<PropertyWrapperMutability>
52335233
getPropertyWrapperMutability() const;
52345234

5235+
/// Returns whether this property is the backing storage property or a storage
5236+
/// wrapper for wrapper instance's projectedValue. If this property is
5237+
/// neither, then it returns `None`.
5238+
Optional<PropertyWrapperSynthesizedPropertyKind>
5239+
getPropertyWrapperSynthesizedPropertyKind() const;
5240+
52355241
/// Retrieve the backing storage property for a property that has an
52365242
/// attached property wrapper.
52375243
///

include/swift/AST/DiagnosticsSema.def

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,9 @@ ERROR(expr_keypath_mutating_getter,none,
557557
ERROR(expr_keypath_static_member,none,
558558
"%select{key path|dynamic key path member lookup}1 cannot refer to static member %0",
559559
(DeclName, bool))
560+
ERROR(expr_keypath_enum_case,none,
561+
"%select{key path|dynamic key path member lookup}1 cannot refer to enum case %0",
562+
(DeclName, bool))
560563
ERROR(expr_keypath_empty,none,
561564
"empty key path does not refer to a property", ())
562565
ERROR(expr_unsupported_objc_key_path_component,none,
@@ -760,12 +763,20 @@ ERROR(invalid_redecl,none,"invalid redeclaration of %0", (DeclName))
760763
ERROR(invalid_redecl_init,none,
761764
"invalid redeclaration of synthesized %select{|memberwise }1%0",
762765
(DeclName, bool))
766+
ERROR(invalid_redecl_implicit,none,
767+
"invalid redeclaration of synthesized "
768+
"%select{%0|implementation for protocol requirement}1 %2",
769+
(DescriptiveDeclKind, bool, DeclName))
763770
WARNING(invalid_redecl_swift5_warning,none,
764771
"redeclaration of %0 is deprecated and will be an error in Swift 5",
765772
(DeclName))
766773

767774
NOTE(invalid_redecl_prev,none,
768775
"%0 previously declared here", (DeclName))
776+
NOTE(invalid_redecl_implicit_wrapper,none,
777+
"%0 synthesized for property wrapper "
778+
"%select{projected value|backing storage}1",
779+
(DeclName, bool))
769780

770781
ERROR(ambiguous_type_base,none,
771782
"%0 is ambiguous for type lookup in this context", (DeclNameRef))

include/swift/AST/Evaluator.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ class Evaluator {
262262
void registerRequestFunctions(Zone zone,
263263
ArrayRef<AbstractRequestFunction *> functions);
264264

265+
void enumerateReferencesInFile(
266+
const SourceFile *SF,
267+
evaluator::DependencyRecorder::ReferenceEnumerator f) const {
268+
return recorder.enumerateReferencesInFile(SF, f);
269+
}
270+
265271
/// Retrieve the result produced by evaluating a request that can
266272
/// be cached.
267273
template<typename Request,

include/swift/AST/EvaluatorDependencies.h

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ using DependencySource = llvm::PointerIntPair<SourceFile *, 1, DependencyScope>;
110110
struct DependencyRecorder;
111111

112112
struct DependencyCollector {
113+
friend DependencyRecorder;
114+
113115
struct Reference {
114116
public:
115117
enum class Kind {
@@ -123,38 +125,41 @@ struct DependencyCollector {
123125

124126
NominalTypeDecl *subject;
125127
DeclBaseName name;
128+
bool cascades;
126129

127130
private:
128-
Reference(Kind kind, NominalTypeDecl *subject, DeclBaseName name)
129-
: kind(kind), subject(subject), name(name) {}
131+
Reference(Kind kind, NominalTypeDecl *subject, DeclBaseName name,
132+
bool cascades)
133+
: kind(kind), subject(subject), name(name), cascades(cascades) {}
130134

131135
public:
132136
static Reference empty() {
133137
return {Kind::Empty, llvm::DenseMapInfo<NominalTypeDecl *>::getEmptyKey(),
134-
llvm::DenseMapInfo<DeclBaseName>::getEmptyKey()};
138+
llvm::DenseMapInfo<DeclBaseName>::getEmptyKey(), false};
135139
}
136140

137141
static Reference tombstone() {
138-
return {Kind::Empty,
142+
return {Kind::Tombstone,
139143
llvm::DenseMapInfo<NominalTypeDecl *>::getTombstoneKey(),
140-
llvm::DenseMapInfo<DeclBaseName>::getTombstoneKey()};
144+
llvm::DenseMapInfo<DeclBaseName>::getTombstoneKey(), false};
141145
}
142146

143147
public:
144-
static Reference usedMember(NominalTypeDecl *subject, DeclBaseName name) {
145-
return {Kind::UsedMember, subject, name};
148+
static Reference usedMember(NominalTypeDecl *subject, DeclBaseName name,
149+
bool cascades) {
150+
return {Kind::UsedMember, subject, name, cascades};
146151
}
147152

148-
static Reference potentialMember(NominalTypeDecl *subject) {
149-
return {Kind::PotentialMember, subject, DeclBaseName()};
153+
static Reference potentialMember(NominalTypeDecl *subject, bool cascades) {
154+
return {Kind::PotentialMember, subject, DeclBaseName(), cascades};
150155
}
151156

152-
static Reference topLevel(DeclBaseName name) {
153-
return {Kind::TopLevel, nullptr, name};
157+
static Reference topLevel(DeclBaseName name, bool cascades) {
158+
return {Kind::TopLevel, nullptr, name, cascades};
154159
}
155160

156-
static Reference dynamic(DeclBaseName name) {
157-
return {Kind::Dynamic, nullptr, name};
161+
static Reference dynamic(DeclBaseName name, bool cascades) {
162+
return {Kind::Dynamic, nullptr, name, cascades};
158163
}
159164

160165
public:
@@ -174,8 +179,12 @@ struct DependencyCollector {
174179
};
175180
};
176181

182+
public:
183+
using ReferenceSet = llvm::DenseSet<Reference, Reference::Info>;
184+
185+
private:
177186
DependencyRecorder &parent;
178-
llvm::DenseSet<Reference, Reference::Info> scratch;
187+
ReferenceSet scratch;
179188

180189
public:
181190
explicit DependencyCollector(DependencyRecorder &parent) : parent(parent) {}
@@ -226,11 +235,7 @@ struct DependencyCollector {
226235
/// particular \c DependencyScope during the course of request evaluation.
227236
struct DependencyRecorder {
228237
friend DependencyCollector;
229-
private:
230-
/// A stack of dependency sources in the order they were evaluated.
231-
llvm::SmallVector<evaluator::DependencySource, 8> dependencySources;
232238

233-
public:
234239
enum class Mode {
235240
// Enables the current "status quo" behavior of the dependency collector.
236241
//
@@ -244,14 +249,19 @@ struct DependencyRecorder {
244249
// the primary file being acted upon instead of to the destination file.
245250
ExperimentalPrivateDependencies,
246251
};
247-
Mode mode;
248-
llvm::DenseMap<AnyRequest, llvm::DenseSet<DependencyCollector::Reference,
249-
DependencyCollector::Reference::Info>>
252+
253+
private:
254+
/// A stack of dependency sources in the order they were evaluated.
255+
llvm::SmallVector<evaluator::DependencySource, 8> dependencySources;
256+
llvm::DenseMap<SourceFile *, DependencyCollector::ReferenceSet>
257+
fileReferences;
258+
llvm::DenseMap<AnyRequest, DependencyCollector::ReferenceSet>
250259
requestReferences;
260+
Mode mode;
251261
bool isRecording;
252262

253-
explicit DependencyRecorder(Mode mode)
254-
: mode{mode}, requestReferences{}, isRecording{false} {};
263+
public:
264+
explicit DependencyRecorder(Mode mode) : mode{mode}, isRecording{false} {};
255265

256266
private:
257267
void realize(const DependencyCollector::Reference &ref);
@@ -261,6 +271,12 @@ struct DependencyRecorder {
261271
void record(const llvm::SetVector<swift::ActiveRequest> &stack,
262272
llvm::function_ref<void(DependencyCollector &)> rec);
263273

274+
public:
275+
using ReferenceEnumerator =
276+
llvm::function_ref<void(const DependencyCollector::Reference &)>;
277+
void enumerateReferencesInFile(const SourceFile *SF,
278+
ReferenceEnumerator f) const ;
279+
264280
public:
265281
/// Returns the scope of the current active scope.
266282
///
@@ -323,25 +339,6 @@ struct DependencyRecorder {
323339
return dependencySources.front().getPointer();
324340
}
325341

326-
/// If there is an active dependency source, returns its
327-
/// \c ReferencedNameTracker. Else, returns \c nullptr.
328-
ReferencedNameTracker *getActiveDependencyTracker() const {
329-
SourceFile *source = nullptr;
330-
switch (mode) {
331-
case Mode::StatusQuo:
332-
source = getActiveDependencySourceOrNull();
333-
break;
334-
case Mode::ExperimentalPrivateDependencies:
335-
source = getFirstDependencySourceOrNull();
336-
break;
337-
}
338-
339-
if (!source)
340-
return nullptr;
341-
342-
return source->getRequestBasedReferencedNameTracker();
343-
}
344-
345342
/// Returns \c true if the scope of the current active source cascades.
346343
///
347344
/// If there is no active scope, the result always cascades.

include/swift/AST/GenericSignature.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,12 @@ class alignas(1 << TypeAlignInBits) GenericSignatureImpl final
329329
/// Determine whether the given dependent type is equal to a concrete type.
330330
bool isConcreteType(Type type) const;
331331

332-
/// Return the concrete type that the given dependent type is constrained to,
332+
/// Return the concrete type that the given type parameter is constrained to,
333333
/// or the null Type if it is not the subject of a concrete same-type
334334
/// constraint.
335335
Type getConcreteType(Type type) const;
336336

337-
/// Return the layout constraint that the given dependent type is constrained
337+
/// Return the layout constraint that the given type parameter is constrained
338338
/// to, or the null LayoutConstraint if it is not the subject of layout
339339
/// constraint.
340340
LayoutConstraint getLayoutConstraint(Type type) const;

include/swift/AST/IRGenOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ class IRGenOptions {
191191
unsigned DisableLLVMSLPVectorizer : 1;
192192

193193
/// Disable frame pointer elimination?
194+
unsigned DisableFPElimLeaf : 1;
194195
unsigned DisableFPElim : 1;
195196

196197
/// Special codegen for playgrounds.
@@ -319,6 +320,7 @@ class IRGenOptions {
319320
DisableClangModuleSkeletonCUs(false), UseJIT(false),
320321
DisableLLVMOptzns(false),
321322
DisableSwiftSpecificLLVMOptzns(false), DisableLLVMSLPVectorizer(false),
323+
DisableFPElimLeaf(false),
322324
DisableFPElim(true), Playground(false), EmitStackPromotionChecks(false),
323325
FunctionSections(false), PrintInlineTree(false), EmbedMode(IRGenEmbedMode::None),
324326
HasValueNamesSetting(false), ValueNames(false),

include/swift/AST/Module.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "swift/AST/Identifier.h"
2323
#include "swift/AST/LookupKinds.h"
2424
#include "swift/AST/RawComment.h"
25-
#include "swift/AST/ReferencedNameTracker.h"
2625
#include "swift/AST/Type.h"
2726
#include "swift/Basic/Compiler.h"
2827
#include "swift/Basic/OptionSet.h"
@@ -69,7 +68,6 @@ namespace swift {
6968
class ProtocolConformance;
7069
class ProtocolDecl;
7170
struct PrintOptions;
72-
class ReferencedNameTracker;
7371
class Token;
7472
class TupleType;
7573
class Type;

include/swift/AST/ReferencedNameTracker.h

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)