Skip to content

Commit def82f1

Browse files
committed
---
yaml --- r: 349031 b: refs/heads/master c: 060cbb2 h: refs/heads/master i: 349029: c2e63dd 349027: 6aae418 349023: 5e9bffe
1 parent 17c937b commit def82f1

Some content is hidden

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

60 files changed

+547
-1630
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: adfd8b358ec21ff75699326168e49ec0ec38940f
2+
refs/heads/master: 060cbb293f46099e25fcba17c8287938c093012b
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/AST/ASTContext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ namespace swift {
109109
class TypeAliasDecl;
110110
class VarDecl;
111111
class UnifiedStatsReporter;
112-
class IndexSubset;
113112

114113
enum class KnownProtocolKind : uint8_t;
115114

trunk/include/swift/AST/ASTScope.h

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
#include "swift/AST/ASTNode.h"
3232
#include "swift/AST/NameLookup.h" // for DeclVisibilityKind
33-
#include "swift/AST/SimpleRequest.h"
3433
#include "swift/Basic/Compiler.h"
3534
#include "swift/Basic/LLVM.h"
3635
#include "swift/Basic/NullablePtr.h"
@@ -89,14 +88,6 @@ struct AnnotatedInsertionPoint {
8988
ASTScopeImpl *insertionPoint;
9089
const char *explanation;
9190
};
92-
} // namespace ast_scope
93-
94-
namespace ast_scope {
95-
96-
void simple_display(llvm::raw_ostream &out, const ASTScopeImpl *);
97-
void simple_display(llvm::raw_ostream &out, const ScopeCreator *);
98-
99-
SourceLoc extractNearestSourceLoc(std::tuple<ASTScopeImpl *, ScopeCreator *>);
10091

10192
#pragma mark the root ASTScopeImpl class
10293

@@ -342,11 +333,6 @@ class ASTScopeImpl {
342333
public:
343334
/// expandScope me, sending deferred nodes to my descendants.
344335
/// Return the scope into which to place subsequent decls
345-
ASTScopeImpl *expandAndBeCurrentDetectingRecursion(ScopeCreator &);
346-
347-
/// Expand or reexpand the scope if unexpanded or if not current.
348-
/// There are several places in the compiler that mutate the AST after the
349-
/// fact, above and beyond adding Decls to the SourceFile.
350336
ASTScopeImpl *expandAndBeCurrent(ScopeCreator &);
351337

352338
unsigned getASTAncestorScopeCount() const { return astAncestorScopeCount; }
@@ -358,12 +344,6 @@ class ASTScopeImpl {
358344
void setWasExpanded() { wasExpanded = true; }
359345
virtual ASTScopeImpl *expandSpecifically(ScopeCreator &) = 0;
360346
virtual void beCurrent();
361-
virtual bool doesExpansionOnlyAddNewDeclsAtEnd() const;
362-
363-
public:
364-
bool isExpansionNeeded(const ScopeCreator &) const;
365-
366-
protected:
367347
bool isCurrent() const;
368348
virtual bool isCurrentIfWasExpanded() const;
369349

@@ -394,7 +374,16 @@ class ASTScopeImpl {
394374

395375
bool isATypeDeclScope() const;
396376

377+
/// There are several places in the compiler that mutate the AST after the
378+
/// fact, above and beyond adding Decls to the SourceFile. These are
379+
/// documented in: rdar://53018839, rdar://53027266, rdar://53027733,
380+
/// rdar://53028050
381+
/// Return true if did reexpand
382+
bool reexpandIfObsolete(ScopeCreator &);
383+
397384
private:
385+
void reexpand(ScopeCreator &);
386+
398387
virtual ScopeCreator &getScopeCreator();
399388

400389
#pragma mark - - creation queries
@@ -544,8 +533,8 @@ class ASTSourceFileScope final : public ASTScopeImpl {
544533
/// The number of \c Decls in the \c SourceFile that were already seen.
545534
/// Since parsing can be interleaved with type-checking, on every
546535
/// lookup, look at creating scopes for any \c Decls beyond this number.
547-
/// TODO: Unify with numberOfChildrenWhenLastExpanded
548-
size_t numberOfDeclsAlreadySeen = 0;
536+
/// rdar://55562483 Unify with numberOfChildrenWhenLastExpanded
537+
int numberOfDeclsAlreadySeen = 0;
549538

550539
ASTSourceFileScope(SourceFile *SF, ScopeCreator *scopeCreator);
551540

@@ -559,6 +548,7 @@ class ASTSourceFileScope final : public ASTScopeImpl {
559548
public:
560549
NullablePtr<DeclContext> getDeclContext() const override;
561550

551+
void addNewDeclsToScopeTree();
562552
void buildFullyExpandedTree();
563553
void
564554
buildEnoughOfTreeForTopLevelExpressionsButDontRequestGenericsOrExtendedNominals();
@@ -569,15 +559,11 @@ class ASTSourceFileScope final : public ASTScopeImpl {
569559

570560
protected:
571561
ASTScopeImpl *expandSpecifically(ScopeCreator &scopeCreator) override;
572-
bool isCurrentIfWasExpanded() const override;
573-
void beCurrent() override;
574-
bool doesExpansionOnlyAddNewDeclsAtEnd() const override;
575562

576563
ScopeCreator &getScopeCreator() override;
577564

578565
private:
579-
AnnotatedInsertionPoint
580-
expandAScopeThatCreatesANewInsertionPoint(ScopeCreator &);
566+
void expandAScopeThatDoesNotCreateANewInsertionPoint(ScopeCreator &);
581567
};
582568

583569
class Portion {
@@ -1162,6 +1148,7 @@ class AttachedPropertyWrapperScope final : public ASTScopeImpl {
11621148
/// false positives, that that doesn't hurt anything. However, the result of
11631149
/// the conservative source range computation doesn't seem to be stable. So
11641150
/// keep the original here, and use it for source range queries.
1151+
/// rdar://55263708
11651152

11661153
const SourceRange sourceRangeWhenCreated;
11671154

@@ -1264,6 +1251,7 @@ class PatternEntryDeclScope final : public AbstractPatternEntryScope {
12641251
};
12651252

12661253
class PatternEntryInitializerScope final : public AbstractPatternEntryScope {
1254+
// Should be able to remove this when rdar://53921703 is accomplished.
12671255
Expr *initAsWrittenWhenCreated;
12681256

12691257
public:

trunk/include/swift/AST/Decl.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4804,8 +4804,7 @@ class VarDecl : public AbstractStorageDecl {
48044804
bool issCaptureList, SourceLoc nameLoc, Identifier name,
48054805
DeclContext *dc, StorageIsMutable_t supportsMutation);
48064806

4807-
/// This is the type specified, including location information.
4808-
TypeLoc typeLoc;
4807+
TypeRepr *ParentRepr = nullptr;
48094808

48104809
Type typeInContext;
48114810

@@ -4825,8 +4824,10 @@ class VarDecl : public AbstractStorageDecl {
48254824
return hasName() ? getBaseName().getIdentifier().str() : "_";
48264825
}
48274826

4828-
TypeLoc &getTypeLoc() { return typeLoc; }
4829-
TypeLoc getTypeLoc() const { return typeLoc; }
4827+
/// Retrieve the TypeRepr corresponding to the parsed type of the parent
4828+
/// pattern, if it exists.
4829+
TypeRepr *getTypeRepr() const { return ParentRepr; }
4830+
void setTypeRepr(TypeRepr *repr) { ParentRepr = repr; }
48304831

48314832
bool hasType() const {
48324833
// We have a type if either the type has been computed already or if

trunk/include/swift/AST/DiagnosticsSIL.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ NOTE(constexpr_witness_call_with_no_conformance, none,
422422
NOTE(constexpr_unknown_control_flow_due_to_skip,none, "branch depends on "
423423
"non-constant value produced by an unevaluated instructions", ())
424424
NOTE(constexpr_returned_by_unevaluated_instruction,none,
425-
"result of an unevaluated instruction is not a constant", ())
425+
"return value of an unevaluated instruction is not a constant", ())
426426
NOTE(constexpr_mutated_by_unevaluated_instruction,none, "value mutable by an "
427427
"unevaluated instruction is not a constant", ())
428428

trunk/include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ ERROR(cannot_convert_argument_value,none,
381381
(Type,Type))
382382

383383
NOTE(candidate_has_invalid_argument_at_position,none,
384-
"candidate expects %select{|in-out }2value of type %0 for parameter #%1",
385-
(Type, unsigned, bool))
384+
"candidate expects value of type %0 for parameter #%1",
385+
(Type, unsigned))
386386

387387
ERROR(cannot_convert_array_to_variadic,none,
388388
"cannot pass array of type %0 as variadic arguments of type %1",

0 commit comments

Comments
 (0)