Skip to content

Commit c6f4065

Browse files
committed
---
yaml --- r: 348815 b: refs/heads/master c: 55a6693 h: refs/heads/master i: 348813: a782c4b 348811: f6d58e7 348807: 704e5a9 348799: eecd3a2
1 parent 0f53062 commit c6f4065

File tree

12 files changed

+46
-45
lines changed

12 files changed

+46
-45
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: 951c6261f37d1ab1384133e99caead6943abd2e0
2+
refs/heads/master: 55a6693da84c7743ed5aa978e0b9ad98965af061
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/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ set(SWIFT_ANALYZE_CODE_COVERAGE FALSE CACHE STRING
125125
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
126126
# can be reused when a new version of Swift comes out (assuming the user hasn't
127127
# manually set it as part of their own CMake configuration).
128-
set(SWIFT_VERSION "5.1.1")
128+
set(SWIFT_VERSION "5.1")
129129

130130
set(SWIFT_VENDOR "" CACHE STRING
131131
"The vendor name of the Swift compiler")

trunk/include/swift/Parse/ASTGen.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ class ASTGen {
6767

6868
private:
6969
DeclAttributes
70-
generateDeclAttributes(const syntax::Syntax &D, SourceLoc Loc,
71-
bool includeComments);
70+
generateDeclAttributes(const syntax::DeclSyntax &D,
71+
const Optional<syntax::AttributeListSyntax> &attrs,
72+
const Optional<syntax::ModifierListSyntax> &modifiers,
73+
SourceLoc Loc, bool includeComments);
7274

7375
void generateFreeStandingGenericWhereClause(
7476
const syntax::GenericWhereClauseSyntax &syntax,

trunk/lib/FrontendTool/FrontendTool.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ static bool writeSIL(SILModule &SM, ModuleDecl *M, bool EmitVerboseSIL,
406406
auto OS = getFileOutputStream(OutputFilename, M->getASTContext());
407407
if (!OS) return true;
408408
SM.print(*OS, EmitVerboseSIL, M, SortSIL);
409-
return false;
409+
410+
return M->getASTContext().hadError();
410411
}
411412

412413
static bool writeSIL(SILModule &SM, const PrimarySpecificPaths &PSPs,

trunk/lib/Parse/ASTGen.cpp

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,21 @@ Decl *ASTGen::generate(const DeclSyntax &D, const SourceLoc Loc) {
5757
}
5858

5959
DeclAttributes
60-
ASTGen::generateDeclAttributes(const Syntax &D, SourceLoc Loc,
61-
bool includeComments) {
62-
// Find the AST attribute-list from the lookup table.
63-
if (auto firstTok = D.getFirstToken()) {
64-
auto declLoc = advanceLocBegin(Loc, *firstTok);
65-
if (hasDeclAttributes(declLoc))
66-
return getDeclAttributes(declLoc);
60+
ASTGen::generateDeclAttributes(const DeclSyntax &D,
61+
const Optional<AttributeListSyntax> &attrs,
62+
const Optional<ModifierListSyntax> &modifiers,
63+
SourceLoc Loc, bool includeComments) {
64+
SourceLoc attrsLoc;
65+
if (attrs) {
66+
attrsLoc = advanceLocBegin(Loc, *attrs->getFirstToken());
67+
} else if (modifiers) {
68+
attrsLoc = advanceLocBegin(Loc, *modifiers->getFirstToken());
69+
} else {
70+
// We might have comment attributes.
71+
attrsLoc = advanceLocBegin(Loc, *D.getFirstToken());
6772
}
73+
if (hasDeclAttributes(attrsLoc))
74+
return getDeclAttributes(attrsLoc);
6875
return DeclAttributes();
6976
}
7077

@@ -104,7 +111,8 @@ TypeDecl *ASTGen::generate(const AssociatedtypeDeclSyntax &D,
104111
Identifier name;
105112
SourceLoc nameLoc = generateIdentifierDeclName(idToken, Loc, name);
106113

107-
DeclAttributes attrs = generateDeclAttributes(D, Loc, true);
114+
DeclAttributes attrs =
115+
generateDeclAttributes(D, D.getAttributes(), D.getModifiers(), Loc, true);
108116

109117
DebuggerContextChange DCC(P, name, DeclKind::AssociatedType);
110118

@@ -139,7 +147,8 @@ TypeDecl *ASTGen::generate(const TypealiasDeclSyntax &D, const SourceLoc Loc) {
139147
auto keywordLoc = advanceLocBegin(Loc, D.getTypealiasKeyword());
140148
Identifier name;
141149
SourceLoc nameLoc = generateIdentifierDeclName(idToken, Loc, name);
142-
auto attrs = generateDeclAttributes(D, Loc, true);
150+
auto attrs =
151+
generateDeclAttributes(D, D.getAttributes(), D.getModifiers(), Loc, true);
143152
SourceLoc equalLoc;
144153

145154
DebuggerContextChange DCC(P, name, DeclKind::TypeAlias);
@@ -977,7 +986,14 @@ GenericParamList *ASTGen::generate(const GenericParameterClauseSyntax &clause,
977986

978987
for (auto elem : clause.getGenericParameterList()) {
979988

980-
DeclAttributes attrs = generateDeclAttributes(elem, Loc, false);
989+
DeclAttributes attrs;
990+
if (auto attrsSyntax = elem.getAttributes()) {
991+
if (auto firstTok = attrsSyntax->getFirstToken()) {
992+
auto attrsLoc = advanceLocBegin(Loc, *firstTok);
993+
if (hasDeclAttributes(attrsLoc))
994+
attrs = getDeclAttributes(attrsLoc);
995+
}
996+
}
981997
Identifier name = Context.getIdentifier(elem.getName().getIdentifierText());
982998
SourceLoc nameLoc = advanceLocBegin(Loc, elem.getName());
983999

trunk/lib/Parse/ParseDecl.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,7 +2714,6 @@ Parser::parseDecl(ParseDeclOptions Flags,
27142714
StructureMarkerKind::Declaration);
27152715

27162716
// Parse attributes.
2717-
SourceLoc AttrsLoc = Tok.getLoc();
27182717
DeclAttributes Attributes;
27192718
if (Tok.hasComment())
27202719
Attributes.add(new (Context) RawDocCommentAttr(Tok.getCommentRange()));
@@ -2726,8 +2725,12 @@ Parser::parseDecl(ParseDeclOptions Flags,
27262725
StaticSpellingKind StaticSpelling = StaticSpellingKind::None;
27272726
parseDeclModifierList(Attributes, StaticLoc, StaticSpelling);
27282727

2729-
if (!Attributes.isEmpty())
2730-
Generator.addDeclAttributes(Attributes, AttrsLoc);
2728+
if (!Attributes.isEmpty()) {
2729+
auto startLoc = Attributes.getStartLoc();
2730+
if (startLoc.isInvalid())
2731+
startLoc = Tok.getLoc();
2732+
Generator.addDeclAttributes(Attributes, startLoc);
2733+
}
27312734

27322735
// We emit diagnostics for 'try let ...' in parseDeclVar().
27332736
SourceLoc tryLoc;

trunk/lib/Parse/ParseGeneric.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,10 @@ Parser::parseGenericParameterClauseSyntax() {
7878
SyntaxParsingContext TmpCtxt(SyntaxContext);
7979
TmpCtxt.setTransparent();
8080

81-
auto AttrsLoc = Tok.getLoc();
8281
DeclAttributes attrsAST;
8382
parseDeclAttributeList(attrsAST);
8483
if (!attrsAST.isEmpty())
85-
Generator.addDeclAttributes(attrsAST, AttrsLoc);
84+
Generator.addDeclAttributes(attrsAST, attrsAST.getStartLoc());
8685
auto attrs = SyntaxContext->popIf<ParsedAttributeListSyntax>();
8786
if (attrs)
8887
paramBuilder.useAttributes(std::move(*attrs));

trunk/lib/SIL/SILOwnershipVerifier.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -642,20 +642,10 @@ void SILValue::verifyOwnership(DeadEndBlocks *deadEndBlocks) const {
642642
if (DisableOwnershipVerification)
643643
return;
644644

645-
// Do not validate SILUndef values.
646-
if (isa<SILUndef>(Value))
647-
return;
648-
649645
#ifdef NDEBUG
650646
// When compiling without asserts enabled, only verify ownership if
651647
// -sil-verify-all is set.
652-
//
653-
// NOTE: We purposely return if we do can not look up a module here to ensure
654-
// that if we run into something that we do not understand, we do not assert
655-
// in user code even tohugh we aren't going to actually verify (the default
656-
// behavior when -sil-verify-all is disabled).
657-
auto *Mod = Value->getModule();
658-
if (!Mod || !Mod->getOptions().VerifyAll)
648+
if (!getModule().getOptions().VerifyAll)
659649
return;
660650
#endif
661651

trunk/test/Parse/attr_available_ignored.swift

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

trunk/test/Serialization/Recovery/types-5-to-4.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import Lib
1616
func requiresConformance(_: B_RequiresConformance<B_ConformsToProto>) {}
1717
func requiresConformance(_: B_RequiresConformance<C_RelyOnConformanceImpl.Assoc>) {}
1818

19-
class Sub: Base {} // expected-error {{cannot inherit from class 'Base' (compiled with Swift 5.1.1) because it has overridable members that could not be loaded in Swift 4.1.50}}
20-
class Impl: Proto {} // expected-error {{type 'Impl' cannot conform to protocol 'Proto' (compiled with Swift 5.1.1) because it has requirements that could not be loaded in Swift 4.1.50}}
19+
class Sub: Base {} // expected-error {{cannot inherit from class 'Base' (compiled with Swift 5.1) because it has overridable members that could not be loaded in Swift 4.1.50}}
20+
class Impl: Proto {} // expected-error {{type 'Impl' cannot conform to protocol 'Proto' (compiled with Swift 5.1) because it has requirements that could not be loaded in Swift 4.1.50}}
2121

2222
#else // TEST
2323

trunk/test/SourceKit/Misc/compiler_version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
// CHECK: key.version_major: 5
44
// CHECK: key.version_minor: 1
5-
// CHECK: key.version_patch: 1
5+
// CHECK: key.version_patch: 0

trunk/utils/build_swift/defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
CMAKE_GENERATOR = 'Ninja'
4141

4242
COMPILER_VENDOR = 'none'
43-
SWIFT_USER_VISIBLE_VERSION = CompilerVersion('5.1.1')
43+
SWIFT_USER_VISIBLE_VERSION = CompilerVersion('5.1')
4444
CLANG_USER_VISIBLE_VERSION = CompilerVersion('7.0.0')
4545
SWIFT_ANALYZE_CODE_COVERAGE = 'false'
4646

0 commit comments

Comments
 (0)