Skip to content

Commit a970a73

Browse files
authored
Merge pull request #1348 from swiftwasm/maxd/5.3-merge
Resolve conflicts with release/5.3
2 parents d2e1ae0 + 25529bf commit a970a73

File tree

337 files changed

+1182
-47375
lines changed

Some content is hidden

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

337 files changed

+1182
-47375
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ jobs:
6363
path: ../build-cache
6464
key: ${{ runner.os }}-sccache-v5-5.3
6565
- name: Build macOS installable archive
66-
run: ./utils/webassembly/ci.sh
66+
run: |
67+
sudo xcode-select --switch /Applications/Xcode_12_beta.app/Contents/Developer/
68+
./utils/webassembly/ci.sh
6769
- name: Upload macOS installable archive
6870
uses: actions/upload-artifact@v1
6971
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Please make sure you use Python 2.x. Python 3.x is not supported currently.
9191

9292
#### macOS
9393

94-
To build for macOS, you need [Xcode 11.4](https://developer.apple.com/xcode/resources/).
94+
To build for macOS, you need [Xcode 12 beta](https://developer.apple.com/xcode/resources/).
9595
The required version of Xcode changes frequently, and is often a beta release.
9696
Check this document or the host information on <https://ci.swift.org> for the
9797
current required version.

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,11 @@ function (swift_benchmark_compile_archopts)
660660
"-m${triple_platform}-version-min=${ver}"
661661
"-lobjc"
662662
"-L${SWIFT_LIBRARY_PATH}/${BENCH_COMPILE_ARCHOPTS_PLATFORM}"
663+
"-L${sdk}/usr/lib/swift"
663664
"-Xlinker" "-rpath"
664665
"-Xlinker" "${SWIFT_LINK_RPATH}"
666+
"-Xlinker" "-rpath"
667+
"-Xlinker" "/usr/lib/swift"
665668
${bench_library_objects}
666669
${bench_driver_objects}
667670
${ld64_add_ast_path_opts}

include/swift/IDE/ConformingMethodList.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class ConformingMethodListConsumer {
4242
public:
4343
virtual ~ConformingMethodListConsumer() {}
4444
virtual void handleResult(const ConformingMethodListResult &result) = 0;
45+
virtual void setReusingASTContext(bool flag) = 0;
4546
};
4647

4748
/// Printing consumer
@@ -53,6 +54,7 @@ class PrintingConformingMethodListConsumer
5354
PrintingConformingMethodListConsumer(llvm::raw_ostream &OS) : OS(OS) {}
5455

5556
void handleResult(const ConformingMethodListResult &result) override;
57+
void setReusingASTContext(bool flag) override {}
5658
};
5759

5860
/// Create a factory for code completion callbacks.

include/swift/IDE/TypeContextInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class TypeContextInfoConsumer {
3838
public:
3939
virtual ~TypeContextInfoConsumer() {}
4040
virtual void handleResults(ArrayRef<TypeContextInfoItem>) = 0;
41+
virtual void setReusingASTContext(bool flag) = 0;
4142
};
4243

4344
/// Printing consumer
@@ -48,6 +49,7 @@ class PrintingTypeContextInfoConsumer : public TypeContextInfoConsumer {
4849
PrintingTypeContextInfoConsumer(llvm::raw_ostream &OS) : OS(OS) {}
4950

5051
void handleResults(ArrayRef<TypeContextInfoItem>) override;
52+
void setReusingASTContext(bool flag) override {}
5153
};
5254

5355
/// Create a factory for code completion callbacks.

lib/AST/Attr.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,11 @@ bool DeclAttribute::printImpl(ASTPrinter &Printer, const PrintOptions &Options,
749749
if (auto *VD = dyn_cast<ValueDecl>(D)) {
750750
if (auto *BD = VD->getOverriddenDecl()) {
751751
if (!BD->hasClangNode() &&
752-
VD->isEffectiveLinkageMoreVisibleThan(BD))
752+
!BD->getFormalAccessScope(VD->getDeclContext(),
753+
/*treatUsableFromInlineAsPublic*/ true)
754+
.isPublic()) {
753755
return false;
756+
}
754757
}
755758
}
756759
break;

lib/Demangling/Demangler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,6 +2007,8 @@ NodePointer Demangler::demangleArchetype() {
20072007
if (!demangleBoundGenerics(boundGenericArgs, retroactiveConformances))
20082008
return nullptr;
20092009
auto Name = popNode();
2010+
if (!Name)
2011+
return nullptr;
20102012
auto opaque = createWithChildren(Node::Kind::OpaqueType, Name,
20112013
createNode(Node::Kind::Index, index));
20122014
auto boundGenerics = createNode(Node::Kind::TypeList);

lib/IDE/CodeCompletion.cpp

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6158,15 +6158,29 @@ void CodeCompletionCallbacksImpl::doneParsing() {
61586158
if (IsAtStartOfLine) {
61596159
// foo() {}
61606160
// <HERE>
6161-
// Global completion.
6161+
61626162
auto &Sink = CompletionContext.getResultSink();
6163-
addDeclKeywords(Sink);
6164-
addStmtKeywords(Sink, MaybeFuncBody);
6165-
addSuperKeyword(Sink);
6166-
addLetVarKeywords(Sink);
6167-
addExprKeywords(Sink);
6168-
addAnyTypeKeyword(Sink, CurDeclContext->getASTContext().TheAnyType);
6169-
DoPostfixExprBeginning();
6163+
if (isa<Initializer>(CurDeclContext))
6164+
CurDeclContext = CurDeclContext->getParent();
6165+
6166+
if (CurDeclContext->isTypeContext()) {
6167+
// Override completion (CompletionKind::NominalMemberBeginning).
6168+
addDeclKeywords(Sink);
6169+
addLetVarKeywords(Sink);
6170+
SmallVector<StringRef, 0> ParsedKeywords;
6171+
CompletionOverrideLookup OverrideLookup(Sink, Context, CurDeclContext,
6172+
ParsedKeywords, SourceLoc());
6173+
OverrideLookup.getOverrideCompletions(SourceLoc());
6174+
} else {
6175+
// Global completion (CompletionKind::PostfixExprBeginning).
6176+
addDeclKeywords(Sink);
6177+
addStmtKeywords(Sink, MaybeFuncBody);
6178+
addSuperKeyword(Sink);
6179+
addLetVarKeywords(Sink);
6180+
addExprKeywords(Sink);
6181+
addAnyTypeKeyword(Sink, Context.TheAnyType);
6182+
DoPostfixExprBeginning();
6183+
}
61706184
} else {
61716185
// foo() {} <HERE>
61726186
// Member completion.

lib/IDE/Formatting.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,11 @@ class FormatWalker : public ASTWalker {
19061906
return Aligner.getContextAndSetAlignment(CtxOverride);
19071907
}
19081908

1909+
// There are no parens at this point, so if there are no parameters either,
1910+
// this shouldn't be a context (it's an implicit parameter list).
1911+
if (!PL->size())
1912+
return None;
1913+
19091914
ListAligner Aligner(SM, TargetLocation, ContextLoc, Range.Start);
19101915
for (auto *PD: *PL)
19111916
Aligner.updateAlignment(PD->getSourceRange(), PD);
@@ -2336,8 +2341,17 @@ class FormatWalker : public ASTWalker {
23362341
return None;
23372342

23382343
ListAligner Aligner(SM, TargetLocation, L, L, R, true);
2339-
for (auto *Elem: AE->getElements())
2340-
Aligner.updateAlignment(Elem->getStartLoc(), Elem->getEndLoc(), Elem);
2344+
for (auto *Elem: AE->getElements()) {
2345+
SourceRange ElemRange = Elem->getSourceRange();
2346+
Aligner.updateAlignment(ElemRange, Elem);
2347+
if (isTargetContext(ElemRange)) {
2348+
Aligner.setAlignmentIfNeeded(CtxOverride);
2349+
return IndentContext {
2350+
ElemRange.Start,
2351+
!OutdentChecker::hasOutdent(SM, ElemRange, Elem)
2352+
};
2353+
}
2354+
}
23412355
return Aligner.getContextAndSetAlignment(CtxOverride);
23422356
}
23432357

lib/Parse/ParseExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3228,7 +3228,7 @@ Parser::parseTrailingClosures(bool isExprBasic, SourceRange calleeRange,
32283228
if (CodeCompletion)
32293229
CodeCompletion->completeLabeledTrailingClosure(CCExpr, Tok.isAtStartOfLine());
32303230
consumeToken(tok::code_complete);
3231-
result.hasCodeCompletion();
3231+
result.setHasCodeCompletion();
32323232
closures.push_back({Identifier(), SourceLoc(), CCExpr});
32333233
continue;
32343234
}

0 commit comments

Comments
 (0)