Skip to content

Commit ec97518

Browse files
committed
---
yaml --- r: 349430 b: refs/heads/master-next c: 5c50412 h: refs/heads/master
1 parent fae285a commit ec97518

File tree

11 files changed

+32
-28
lines changed

11 files changed

+32
-28
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 986a036685f7456d79d71ee7e4d131c99066c99b
3+
refs/heads/master-next: 5c5041235bd220ac07f4ef26cbc23a8678d00627
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/include/swift/AST/DiagnosticsClangImporter.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ 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-
9894
#ifndef DIAG_NO_UNDEF
9995
# if defined(DIAG)
10096
# undef DIAG

branches/master-next/include/swift/ClangImporter/ClangImporterOptions.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ class ClangImporterOptions {
9696
/// When set, don't enforce warnings with -Werror.
9797
bool DebuggerSupport = false;
9898

99-
/// When set, clobber the Clang instance's virtual file system with the Swift
100-
/// virtual file system.
101-
bool ForceUseSwiftVirtualFileSystem = false;
102-
10399
/// Return a hash code of any components from these options that should
104100
/// contribute to a Swift Bridging PCH hash.
105101
llvm::hash_code getPCHHashComponents() const {

branches/master-next/lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,17 +1032,10 @@ ClangImporter::create(ASTContext &ctx, const ClangImporterOptions &importerOpts,
10321032

10331033
// Set up the file manager.
10341034
{
1035-
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS;
1036-
if (!ctx.SearchPathOpts.VFSOverlayFiles.empty() ||
1037-
importerOpts.ForceUseSwiftVirtualFileSystem) {
1038-
// If the clang instance has overlays it means the user has provided
1039-
// -ivfsoverlay options. We're going to clobber their file system with
1040-
// the Swift file system, so warn about it.
1041-
if (!instance.getHeaderSearchOpts().VFSOverlayFiles.empty()) {
1042-
ctx.Diags.diagnose(SourceLoc(), diag::clang_vfs_overlay_is_ignored);
1043-
}
1044-
VFS = ctx.SourceMgr.getFileSystem();
1045-
}
1035+
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS =
1036+
clang::createVFSFromCompilerInvocation(instance.getInvocation(),
1037+
instance.getDiagnostics(),
1038+
ctx.SourceMgr.getFileSystem());
10461039
instance.createFileManager(std::move(VFS));
10471040
}
10481041

branches/master-next/lib/Frontend/Frontend.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,6 @@ static bool loadAndValidateVFSOverlay(
243243
const llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> &BaseFS,
244244
const llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> &OverlayFS,
245245
DiagnosticEngine &Diag) {
246-
// FIXME: It should be possible to allow chained lookup of later VFS overlays
247-
// through the mapping defined by earlier overlays.
248-
// See rdar://problem/39440687
249246
auto Buffer = BaseFS->getBufferForFile(File);
250247
if (!Buffer) {
251248
Diag.diagnose(SourceLoc(), diag::cannot_open_file, File,
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
module VFSMappedModule {
22
header "VFSMappedModule.h"
33
}
4+
5+
module YetAnotherVFSMappedModule {
6+
header "YetAnotherVFSMappedModule.h"
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#define MAJOR_SUCCESS 1
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
'version': 0,
3+
'use-external-names': false,
4+
'roots': [
5+
{
6+
'name': 'OUT_DIR', 'type': 'directory',
7+
'contents': [
8+
{ 'name': 'YetAnotherVFSMappedModule.h', 'type': 'file',
9+
'external-contents': 'INPUT_DIR/vfs/b-header'
10+
},
11+
{ 'name': 'YetAnotherVFSMappedModule.framework/Headers/VFSMappedModule.h', 'type': 'file',
12+
'external-contents': 'INPUT_DIR/vfs/b-header'
13+
},
14+
]
15+
},
16+
]
17+
}

branches/master-next/test/Frontend/vfs.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// RUN: sed -e "s|INPUT_DIR|%/S/Inputs|g" -e "s|OUT_DIR|%/t|g" %S/Inputs/vfs/vfsoverlay.yaml > %t/overlay.yaml
33
// RUN: sed -e "s|INPUT_DIR|%/S/Inputs|g" -e "s|OUT_DIR|%/t|g" %S/Inputs/vfs/secondary-vfsoverlay.yaml > %t/secondary-overlay.yaml
44
// RUN: sed -e "s|INPUT_DIR|%/S/Inputs|g" -e "s|OUT_DIR|%/t|g" %S/Inputs/vfs/tertiary-vfsoverlay.yaml > %t/tertiary-overlay.yaml
5+
// RUN: sed -e "s|INPUT_DIR|%/S/Inputs|g" -e "s|OUT_DIR|%/t|g" %S/Inputs/vfs/quaternary-vfsoverlay.yaml > %t/quaternary-vfsoverlay.yaml
56

67
// RUN: not %target-swift-frontend -vfsoverlay %/t/overlay.yaml -typecheck %s %/t/mapped-file.swift -serialize-diagnostics-path %/t/basic.dia 2>&1 | %FileCheck -check-prefix=BASIC_MAPPING_ERROR %s
78
// RUN: c-index-test -read-diagnostics %/t/basic.dia 2>&1 | %FileCheck -check-prefix=BASIC_MAPPING_ERROR %s
@@ -20,10 +21,11 @@
2021
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %/t -DTEST_VFS_CLANG_IMPORTER -Xcc -ivfsoverlay -Xcc %/t/overlay.yaml -typecheck %/s
2122

2223
// If we see -ivfsoverlay and -vfsoverlay, we'll clobber Clang's VFS with our own.
23-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %/t -DTEST_VFS_CLANG_IMPORTER -vfsoverlay %/t/overlay.yaml -Xcc -ivfsoverlay -Xcc %/t/overlay.yaml -typecheck %/s 2>&1 | %FileCheck -check-prefix=WARN_VFS_CLOBBERED %s
24-
25-
// WARN_VFS_CLOBBERED: warning: ignoring '-ivfsoverlay' options provided to '-Xcc' in favor of '-vfsoverlay'
24+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %/t -DTEST_VFS_CLANG_IMPORTER -DTEST_VFS_CLANG_IMPORTER_MERGE -vfsoverlay %/t/overlay.yaml -Xcc -ivfsoverlay -Xcc %/t/quaternary-vfsoverlay.yaml -typecheck %/s 2>&1
2625

2726
#if TEST_VFS_CLANG_IMPORTER
2827
import VFSMappedModule
28+
#if TEST_VFS_CLANG_IMPORTER_MERGE
29+
import YetAnotherVFSMappedModule
30+
#endif
2931
#endif

branches/master-next/tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,6 @@ ASTUnitRef ASTProducer::createASTUnit(
950950

951951
if (fileSystem != llvm::vfs::getRealFileSystem()) {
952952
CompIns.getSourceMgr().setFileSystem(fileSystem);
953-
Invocation.getClangImporterOptions().ForceUseSwiftVirtualFileSystem = true;
954953
}
955954

956955
if (CompIns.setup(Invocation)) {

branches/master-next/tools/SourceKit/lib/SwiftLang/SwiftCompletion.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ static bool swiftCodeCompleteImpl(
200200

201201
if (FileSystem != llvm::vfs::getRealFileSystem()) {
202202
CI.getSourceMgr().setFileSystem(FileSystem);
203-
Invocation.getClangImporterOptions().ForceUseSwiftVirtualFileSystem = true;
204203
}
205204

206205
if (CI.setup(Invocation)) {

0 commit comments

Comments
 (0)