Skip to content

Commit 3d0fa0e

Browse files
committed
---
yaml --- r: 341469 b: refs/heads/rxwei-patch-1 c: d0c5b6a h: refs/heads/master i: 341467: 03a570c
1 parent 2a41cd9 commit 3d0fa0e

File tree

23 files changed

+392
-667
lines changed

23 files changed

+392
-667
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: c6b8ae5f1e04f507e07d62f9b01200f8c6b13aef
1018+
refs/heads/rxwei-patch-1: d0c5b6a4e19bcba893b49563c989d4affafff1df
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
|**[Debian 9.1 (Raspberry Pi)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/armv7_debian_stretch.json)** | ARMv7 | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_1/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_1)|
1818
|**[Fedora 27](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_fedora_27.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-fedora-27/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-fedora-27)|
1919
|**[Ubuntu 16.04](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04)|
20-
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/ppc64le_ubuntu_16_04.json)** | PPC64LE |[![Build Status](https://ci-external.swift.org/job/oss-swift-5.1-RA-linux-ubuntu-16.04-ppc64le/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-5.1-RA-linux-ubuntu-16.04-ppc64le)|
20+
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/ppc64le_ubuntu_16_04.json)** | PPC64LE |[![Build Status](https://ci-external.swift.org/job/oss-swift-4.1-RA-linux-ubuntu-16.04-ppc64le/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-4.1-RA-linux-ubuntu-16.04-ppc64le)|
2121
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_ubuntu_16.04.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64)|
2222
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | ARMv7 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android)|
2323
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64)|

branches/rxwei-patch-1/include/swift/AST/DiagnosticsClangImporter.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ WARNING(implicit_bridging_header_imported_from_module,none,
9191
"is deprecated and will be removed in a later version of Swift",
9292
(StringRef, Identifier))
9393

94+
WARNING(clang_vfs_overlay_is_ignored,none,
95+
"ignoring '-ivfsoverlay' options provided to '-Xcc' in favor of "
96+
"'-vfsoverlay'", ())
97+
9498
#ifndef DIAG_NO_UNDEF
9599
# if defined(DIAG)
96100
# undef DIAG

branches/rxwei-patch-1/include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,6 @@ namespace swift {
314314
/// and faster rebuilds.
315315
bool EnableExperimentalDependencies = false;
316316

317-
/// Enable the experimental opaque result types feature.
318-
bool EnableOpaqueResultTypes = true;
319-
320317
/// To mimic existing system, set to false.
321318
/// To experiment with including file-private and private dependency info,
322319
/// set to true.

branches/rxwei-patch-1/include/swift/Basic/SourceManager.h

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,10 @@
2323

2424
namespace swift {
2525

26-
static inline llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>
27-
getRealOverlayFileSystem() {
28-
return llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>(
29-
new llvm::vfs::OverlayFileSystem(llvm::vfs::getRealFileSystem()));
30-
}
31-
3226
/// This class manages and owns source buffers.
3327
class SourceManager {
3428
llvm::SourceMgr LLVMSourceMgr;
35-
llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> FileSystem;
29+
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FileSystem;
3630
unsigned CodeCompletionBufferID = 0U;
3731
unsigned CodeCompletionOffset;
3832

@@ -55,9 +49,9 @@ class SourceManager {
5549
mutable std::pair<const char *, const VirtualFile*> CachedVFile = {nullptr, nullptr};
5650

5751
public:
58-
SourceManager(llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> FS =
59-
getRealOverlayFileSystem())
60-
: FileSystem(FS) {}
52+
SourceManager(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS =
53+
llvm::vfs::getRealFileSystem())
54+
: FileSystem(FS) {}
6155

6256
llvm::SourceMgr &getLLVMSourceMgr() {
6357
return LLVMSourceMgr;
@@ -66,12 +60,11 @@ class SourceManager {
6660
return LLVMSourceMgr;
6761
}
6862

69-
void
70-
setFileSystem(llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> FS) {
63+
void setFileSystem(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS) {
7164
FileSystem = FS;
7265
}
7366

74-
llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> getFileSystem() {
67+
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> getFileSystem() {
7568
return FileSystem;
7669
}
7770

@@ -261,3 +254,4 @@ class SourceManager {
261254
} // end namespace swift
262255

263256
#endif // SWIFT_BASIC_SOURCEMANAGER_H
257+

branches/rxwei-patch-1/include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,6 @@ def solver_enable_operator_designated_types :
413413
Flag<["-"], "solver-enable-operator-designated-types">,
414414
HelpText<"Enable operator designated types in constraint solver">;
415415

416-
def enable_opaque_result_types :
417-
Flag<["-"], "enable-opaque-result-types">,
418-
HelpText<"Enable experimental opaque result types feature">;
419-
420416
def switch_checking_invocation_threshold_EQ : Joined<["-"],
421417
"switch-checking-invocation-threshold=">;
422418

branches/rxwei-patch-1/lib/AST/Type.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,23 +1233,16 @@ CanType TypeBase::getCanonicalType(GenericSignature *sig) {
12331233
}
12341234

12351235
TypeBase *TypeBase::reconstituteSugar(bool Recursive) {
1236-
auto Func = [Recursive](Type Ty) -> Type {
1236+
auto Func = [](Type Ty) -> Type {
12371237
if (auto boundGeneric = dyn_cast<BoundGenericType>(Ty.getPointer())) {
1238-
1239-
auto getGenericArg = [&](unsigned i) -> Type {
1240-
auto arg = boundGeneric->getGenericArgs()[i];
1241-
if (Recursive)
1242-
arg = arg->reconstituteSugar(Recursive);
1243-
return arg;
1244-
};
1245-
12461238
auto &ctx = boundGeneric->getASTContext();
12471239
if (boundGeneric->getDecl() == ctx.getArrayDecl())
1248-
return ArraySliceType::get(getGenericArg(0));
1240+
return ArraySliceType::get(boundGeneric->getGenericArgs()[0]);
12491241
if (boundGeneric->getDecl() == ctx.getDictionaryDecl())
1250-
return DictionaryType::get(getGenericArg(0), getGenericArg(1));
1242+
return DictionaryType::get(boundGeneric->getGenericArgs()[0],
1243+
boundGeneric->getGenericArgs()[1]);
12511244
if (boundGeneric->getDecl() == ctx.getOptionalDecl())
1252-
return OptionalType::get(getGenericArg(0));
1245+
return OptionalType::get(boundGeneric->getGenericArgs()[0]);
12531246
}
12541247
return Ty;
12551248
};

branches/rxwei-patch-1/lib/ClangImporter/ClangImporter.cpp

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,35 +1012,14 @@ ClangImporter::create(ASTContext &ctx,
10121012

10131013
// Set up the file manager.
10141014
{
1015-
if (instance.getHeaderSearchOpts().VFSOverlayFiles.empty()) {
1016-
instance.setVirtualFileSystem(ctx.SourceMgr.getFileSystem());
1017-
} else {
1018-
// Initialize the clang VFS from its compiler invocation.
1019-
instance.createFileManager();
1020-
1021-
// Create a new overlay file system for the clang importer with the clang
1022-
// VFS as its root.
1023-
auto ClangImporterFS =
1024-
llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>(
1025-
new llvm::vfs::OverlayFileSystem(
1026-
&instance.getVirtualFileSystem()));
1027-
1028-
auto SwiftFS = ctx.SourceMgr.getFileSystem();
1029-
auto it = SwiftFS->overlays_rbegin();
1030-
auto end = SwiftFS->overlays_rend();
1031-
1032-
// The Swift file system is an overlay file system with the real file
1033-
// system as its root. Skip the root so we query the other overlays
1034-
// before falling back to the real file system.
1035-
it++;
1036-
1037-
// Add all remaining Swift overlay file systems to the new file system.
1038-
while (it != end) {
1039-
ClangImporterFS->pushOverlay(*it);
1040-
it++;
1015+
if (!ctx.SearchPathOpts.VFSOverlayFiles.empty()) {
1016+
// If the clang instance has overlays it means the user has provided
1017+
// -ivfsoverlay options and swift -vfsoverlay options. We're going to
1018+
// clobber their file system with our own, so warn about it.
1019+
if (!instance.getHeaderSearchOpts().VFSOverlayFiles.empty()) {
1020+
ctx.Diags.diagnose(SourceLoc(), diag::clang_vfs_overlay_is_ignored);
10411021
}
1042-
1043-
instance.setVirtualFileSystem(ClangImporterFS);
1022+
instance.setVirtualFileSystem(ctx.SourceMgr.getFileSystem());
10441023
}
10451024
instance.createFileManager();
10461025
}

branches/rxwei-patch-1/lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
276276
Opts.EnableOperatorDesignatedTypes |=
277277
Args.hasArg(OPT_enable_operator_designated_types);
278278

279-
Opts.EnableOpaqueResultTypes |=
280-
Args.hasArg(OPT_enable_opaque_result_types);
281-
282279
// Always enable operator designated types for the standard library.
283280
Opts.EnableOperatorDesignatedTypes |= FrontendOpts.ParseStdlib;
284281

branches/rxwei-patch-1/lib/Frontend/Frontend.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ static bool loadAndValidateVFSOverlay(
235235
const llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> &BaseFS,
236236
const llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> &OverlayFS,
237237
DiagnosticEngine &Diag) {
238+
// FIXME: It should be possible to allow chained lookup of later VFS overlays
239+
// through the mapping defined by earlier overlays.
240+
// See rdar://problem/39440687
238241
auto Buffer = BaseFS->getBufferForFile(File);
239242
if (!Buffer) {
240243
Diag.diagnose(SourceLoc(), diag::cannot_open_file, File,
@@ -261,7 +264,14 @@ bool CompilerInstance::setUpVirtualFileSystemOverlays() {
261264
hadAnyFailure |=
262265
loadAndValidateVFSOverlay(File, BaseFS, OverlayFS, Diagnostics);
263266
}
264-
SourceMgr.setFileSystem(OverlayFS);
267+
268+
// If we successfully loaded all the overlays, let the source manager and
269+
// diagnostic engine take advantage of the overlay file system.
270+
if (!hadAnyFailure &&
271+
(OverlayFS->overlays_begin() != OverlayFS->overlays_end())) {
272+
SourceMgr.setFileSystem(OverlayFS);
273+
}
274+
265275
return hadAnyFailure;
266276
}
267277

branches/rxwei-patch-1/lib/Frontend/ParseableInterfaceModuleLoader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static Optional<StringRef> getRelativeDepPath(StringRef DepPath,
273273
/// output path.
274274
/// \note Needs to be in the swift namespace so CompilerInvocation can see it.
275275
class swift::ParseableInterfaceBuilder {
276-
llvm::vfs::OverlayFileSystem &fs;
276+
llvm::vfs::FileSystem &fs;
277277
DiagnosticEngine &diags;
278278
const StringRef interfacePath;
279279
const StringRef moduleName;
@@ -765,7 +765,7 @@ class ParseableInterfaceModuleLoaderImpl {
765765
using AccessPathElem = std::pair<Identifier, SourceLoc>;
766766
friend class swift::ParseableInterfaceModuleLoader;
767767
ASTContext &ctx;
768-
llvm::vfs::OverlayFileSystem &fs;
768+
llvm::vfs::FileSystem &fs;
769769
DiagnosticEngine &diags;
770770
ModuleRebuildInfo rebuildInfo;
771771
const StringRef modulePath;

branches/rxwei-patch-1/lib/Parse/ParseType.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,7 @@ Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
697697
// This is only semantically allowed in certain contexts, but we parse it
698698
// generally for diagnostics and recovery.
699699
SourceLoc opaqueLoc;
700-
if (Context.LangOpts.EnableOpaqueResultTypes
701-
&& Tok.is(tok::identifier)
702-
&& Tok.getRawText() == "some") {
700+
if (Tok.is(tok::identifier) && Tok.getRawText() == "some") {
703701
// Treat some as a keyword.
704702
TokReceiver->registerTokenKindChange(Tok.getLoc(), tok::contextual_keyword);
705703
opaqueLoc = consumeToken();
@@ -765,9 +763,7 @@ Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
765763
}
766764

767765
// Diagnose invalid `some` after an ampersand.
768-
if (Context.LangOpts.EnableOpaqueResultTypes
769-
&& Tok.is(tok::identifier)
770-
&& Tok.getRawText() == "some") {
766+
if (Tok.is(tok::identifier) && Tok.getRawText() == "some") {
771767
auto badLoc = consumeToken();
772768

773769
// TODO: Fixit to move to beginning of composition.

0 commit comments

Comments
 (0)