Skip to content

Commit 0e84394

Browse files
committed
---
yaml --- r: 343245 b: refs/heads/master-rebranch c: 1e173d8 h: refs/heads/master i: 343243: 09e64fa
1 parent 3210894 commit 0e84394

File tree

68 files changed

+366
-1655
lines changed

Some content is hidden

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

68 files changed

+366
-1655
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14551455
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14561456
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14571457
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1458-
refs/heads/master-rebranch: e49401bbca52dad71d6d6390aed8845fa0bed9bf
1458+
refs/heads/master-rebranch: 1e173d8931e70817080eb19aafe2ed4852d1f5ef
14591459
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
14601460
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
14611461
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec

branches/master-rebranch/include/swift/AST/ASTContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ class ASTContext final {
826826
/// of the given decl context.
827827
///
828828
/// \param IDC The context whose member decls should be lazily parsed.
829-
std::vector<Decl *> parseMembers(IterableDeclContext *IDC);
829+
void parseMembers(IterableDeclContext *IDC);
830830

831831
/// Get the lazy function data for the given generic context.
832832
///

branches/master-rebranch/include/swift/AST/ASTTypeIDZone.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,3 @@ SWIFT_TYPEID(AncestryFlags)
3333
SWIFT_TYPEID_NAMED(GenericSignature *, GenericSignature)
3434
SWIFT_TYPEID_NAMED(GenericTypeParamType *, GenericTypeParamType)
3535
SWIFT_TYPEID(Requirement)
36-
SWIFT_TYPEID_NAMED(IterableDeclContext *, IterableDeclContext)

branches/master-rebranch/include/swift/AST/ASTTypeIDs.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,19 @@
1717
#ifndef SWIFT_AST_ASTTYPEIDS_H
1818
#define SWIFT_AST_ASTTYPEIDS_H
1919

20-
#include "swift/Basic/LLVM.h"
2120
#include "swift/Basic/TypeID.h"
2221
namespace swift {
2322

2423
class CustomAttr;
25-
class Decl;
2624
class GenericSignature;
2725
class GenericTypeParamType;
28-
class IterableDeclContext;
2926
class NominalTypeDecl;
30-
class OperatorDecl;
3127
struct PropertyWrapperBackingPropertyInfo;
3228
struct PropertyWrapperTypeInfo;
3329
enum class CtorInitializerKind;
3430
struct PropertyWrapperMutability;
35-
class ProtocolDecl;
3631
class Requirement;
37-
enum class ResilienceExpansion : unsigned;
3832
class Type;
39-
class ValueDecl;
4033
class VarDecl;
4134
class TypeAliasDecl;
4235
class Type;

branches/master-rebranch/include/swift/AST/Decl.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7248,17 +7248,6 @@ void simple_display(llvm::raw_ostream &out, const Decl *decl);
72487248
/// Display ValueDecl subclasses.
72497249
void simple_display(llvm::raw_ostream &out, const ValueDecl *decl);
72507250

7251-
/// Display ExtensionDecls.
7252-
inline void simple_display(llvm::raw_ostream &out, const ExtensionDecl *decl) {
7253-
simple_display(out, static_cast<const Decl *>(decl));
7254-
}
7255-
7256-
/// Display NominalTypeDecls.
7257-
inline void simple_display(llvm::raw_ostream &out,
7258-
const NominalTypeDecl *decl) {
7259-
simple_display(out, static_cast<const Decl *>(decl));
7260-
}
7261-
72627251
/// Extract the source location from the given declaration.
72637252
SourceLoc extractNearestSourceLoc(const Decl *decl);
72647253

@@ -7272,11 +7261,6 @@ inline SourceLoc extractNearestSourceLoc(const GenericTypeDecl *type) {
72727261
return extractNearestSourceLoc(static_cast<const Decl *>(type));
72737262
}
72747263

7275-
/// Extract the source location from the given declaration.
7276-
inline SourceLoc extractNearestSourceLoc(const NominalTypeDecl *type) {
7277-
return extractNearestSourceLoc(static_cast<const Decl *>(type));
7278-
}
7279-
72807264
/// Extract the source location from the given declaration.
72817265
inline SourceLoc extractNearestSourceLoc(const AbstractFunctionDecl *func) {
72827266
return extractNearestSourceLoc(static_cast<const Decl *>(func));

branches/master-rebranch/include/swift/AST/DeclContext.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,8 @@ class IterableDeclContext {
699699
/// time, but I think it's a better trade to just keep a count here.
700700
unsigned MemberCount : 29;
701701

702-
/// Whether we have already added the parsed members into the context.
703-
unsigned AddedParsedMembers : 1;
702+
/// Whether parsing the members of this context has been delayed.
703+
unsigned HasUnparsedMembers : 1;
704704

705705
/// Whether delayed parsing detected a possible operator definition
706706
/// while skipping the body of this context.
@@ -722,8 +722,8 @@ class IterableDeclContext {
722722
IterableDeclContext(IterableDeclContextKind kind)
723723
: LastDeclAndKind(nullptr, kind) {
724724
MemberCount = 0;
725-
AddedParsedMembers = 0;
726725
HasOperatorDeclarations = 0;
726+
HasUnparsedMembers = 0;
727727
HasNestedClassDeclarations = 0;
728728
}
729729

@@ -732,7 +732,13 @@ class IterableDeclContext {
732732
return LastDeclAndKind.getInt();
733733
}
734734

735-
bool hasUnparsedMembers() const;
735+
bool hasUnparsedMembers() const {
736+
return HasUnparsedMembers;
737+
}
738+
739+
void setHasUnparsedMembers() {
740+
HasUnparsedMembers = 1;
741+
}
736742

737743
bool maybeHasOperatorDeclarations() const {
738744
return HasOperatorDeclarations;
@@ -833,14 +839,9 @@ void simple_display(llvm::raw_ostream &out, const ParamT *dc) {
833839
out << "(null)";
834840
}
835841

836-
void simple_display(llvm::raw_ostream &out, const IterableDeclContext *idc);
837-
838842
/// Extract the source location from the given declaration context.
839843
SourceLoc extractNearestSourceLoc(const DeclContext *dc);
840844

841-
/// Extract the source location from the given declaration context.
842-
SourceLoc extractNearestSourceLoc(const IterableDeclContext *idc);
843-
844845
} // end namespace swift
845846

846847
namespace llvm {

branches/master-rebranch/include/swift/AST/LazyResolver.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ class LazyMemberParser {
9090
public:
9191
virtual ~LazyMemberParser() = default;
9292

93-
/// Retrieves the parsed members for the given decl context \p IDC.
94-
virtual std::vector<Decl *> parseMembers(IterableDeclContext *IDC) = 0;
93+
/// Populates a given decl context \p IDC with all of its members.
94+
///
95+
/// The implementation should add the members to IDC.
96+
virtual void parseMembers(IterableDeclContext *IDC) = 0;
9597

9698
/// Return whether the iterable decl context needs parsing.
9799
virtual bool hasUnparsedMembers(const IterableDeclContext *IDC) = 0;

branches/master-rebranch/include/swift/AST/ParseRequests.h

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

branches/master-rebranch/include/swift/AST/ParseTypeIDZone.def

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

branches/master-rebranch/include/swift/Basic/Statistics.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,6 @@ FRONTEND_STATISTIC(Parse, NumFunctionsParsed)
195195
/// Number of full braced decl list parsed.
196196
FRONTEND_STATISTIC(Parse, NumIterableDeclContextParsed)
197197

198-
#define SWIFT_REQUEST(ZONE, NAME) FRONTEND_STATISTIC(Parse, NAME)
199-
#include "swift/AST/ParseTypeIDZone.def"
200-
#undef SWIFT_REQUEST
201-
202198
/// Number of conformances that were deserialized by this frontend job.
203199
FRONTEND_STATISTIC(Sema, NumConformancesDeserialized)
204200

branches/master-rebranch/include/swift/Basic/TypeID.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ enum class Zone : uint8_t {
3535
IDE = 137,
3636
IDETypeChecking = 97,
3737
NameLookup = 9,
38-
Parse = 8,
3938
TypeChecker = 10,
4039
// N.B. This is not a formal zone and exists solely to support the unit tests.
4140
ArithmeticEvaluator = 255,

branches/master-rebranch/include/swift/Parse/Parser.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ class Parser {
971971

972972
void parseDeclDelayed();
973973

974-
std::vector<Decl *> parseDeclListDelayed(IterableDeclContext *IDC);
974+
void parseDeclListDelayed(IterableDeclContext *IDC);
975975

976976
bool parseMemberDeclList(SourceLoc LBLoc, SourceLoc &RBLoc,
977977
SourceLoc PosBeforeLB,
@@ -1080,10 +1080,9 @@ class Parser {
10801080
ParserStatus parseDeclItem(bool &PreviousHadSemi,
10811081
Parser::ParseDeclOptions Options,
10821082
llvm::function_ref<void(Decl*)> handler);
1083-
std::vector<Decl *> parseDeclList(SourceLoc LBLoc, SourceLoc &RBLoc,
1084-
Diag<> ErrorDiag, ParseDeclOptions Options,
1085-
IterableDeclContext *IDC,
1086-
bool &hadError);
1083+
bool parseDeclList(SourceLoc LBLoc, SourceLoc &RBLoc,
1084+
Diag<> ErrorDiag, ParseDeclOptions Options,
1085+
IterableDeclContext *IDC);
10871086
ParserResult<ExtensionDecl> parseDeclExtension(ParseDeclOptions Flags,
10881087
DeclAttributes &Attributes);
10891088
ParserResult<EnumDecl> parseDeclEnum(ParseDeclOptions Flags,

branches/master-rebranch/include/swift/Parse/PersistentParserState.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class PersistentParserState: public LazyMemberParser {
153153
void delayTopLevel(TopLevelCodeDecl *TLCD, SourceRange BodyRange,
154154
SourceLoc PreviousLoc);
155155

156-
std::vector<Decl *> parseMembers(IterableDeclContext *IDC) override;
156+
void parseMembers(IterableDeclContext *IDC) override;
157157

158158
bool hasDelayedDecl() {
159159
return CodeCompletionDelayedDeclState.get() != nullptr;

branches/master-rebranch/include/swift/SILOptimizer/PassManager/Passes.def

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/// This macro follows the same conventions as PASS(Id, Tag, Description),
3737
/// but is used for IRGen passes which are built outside of the
3838
/// SILOptimizer library.
39-
///
39+
///
4040
/// An IRGen pass is created by IRGen and needs to be registered with the pass
4141
/// manager dynamically.
4242
#ifndef IRGEN_PASS
@@ -312,8 +312,6 @@ PASS(SerializeSILPass, "serialize-sil",
312312
PASS(YieldOnceCheck, "yield-once-check",
313313
"Check correct usage of yields in yield-once coroutines")
314314
PASS(OSLogOptimization, "os-log-optimization", "Optimize os log calls")
315-
PASS(MandatoryCombiner, "mandatory-combiner",
316-
"Perform mandatory peephole combines")
317315
PASS(BugReducerTester, "bug-reducer-tester",
318316
"sil-bug-reducer Tool Testing by Asserting on a Sentinel Function")
319317
PASS_RANGE(AllPasses, AADumper, BugReducerTester)

branches/master-rebranch/include/swift/Serialization/ModuleFormat.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
5252
/// describe what change you made. The content of this comment isn't important;
5353
/// it just ensures a conflict if two people change the module format.
5454
/// Don't worry about adhering to the 80-column limit for this line.
55-
const uint16_t SWIFTMODULE_VERSION_MINOR = 517; // better string hash seed
56-
57-
/// A standard hash seed used for all string hashes in a serialized module.
58-
///
59-
/// This is the same as the default used by llvm::djbHash, just provided
60-
/// explicitly here to note that it's part of the format.
61-
const uint32_t SWIFTMODULE_HASH_SEED = 5381;
55+
const uint16_t SWIFTMODULE_VERSION_MINOR = 516; // encode GenericSignature and GenericEnvironment together
6256

6357
using DeclIDField = BCFixed<31>;
6458

branches/master-rebranch/include/swift/Subsystems.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,6 @@ namespace swift {
389389
/// The ASTContext will automatically call these upon construction.
390390
void registerNameLookupRequestFunctions(Evaluator &evaluator);
391391

392-
/// Register Parse-level request functions with the evaluator.
393-
///
394-
/// Clients that form an ASTContext and will perform any parsing queries
395-
/// using Parse-level logic should call these functions after forming the
396-
/// ASTContext.
397-
void registerParseRequestFunctions(Evaluator &evaluator);
398-
399392
/// Register Sema-level request functions with the evaluator.
400393
///
401394
/// Clients that form an ASTContext and will perform any semantic queries

branches/master-rebranch/lib/AST/ASTContext.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,14 +2015,12 @@ LazyContextData *ASTContext::getOrCreateLazyContextData(
20152015
return entry;
20162016
}
20172017

2018-
std::vector<Decl *> ASTContext::parseMembers(IterableDeclContext *IDC) {
2018+
void ASTContext::parseMembers(IterableDeclContext *IDC) {
20192019
assert(IDC->hasUnparsedMembers());
20202020
for (auto *p: getImpl().lazyParsers) {
20212021
if (p->hasUnparsedMembers(IDC))
2022-
return p->parseMembers(IDC);
2022+
p->parseMembers(IDC);
20232023
}
2024-
2025-
return { };
20262024
}
20272025

20282026
LazyIterableDeclContextData *ASTContext::getOrCreateLazyIterableContextData(

0 commit comments

Comments
 (0)