File tree Expand file tree Collapse file tree 5 files changed +51
-1
lines changed
source/Plugins/TypeSystem/Swift Expand file tree Collapse file tree 5 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -3636,9 +3636,12 @@ ThreadSafeASTContext SwiftASTContext::GetASTContext() {
3636
3636
m_dwarfimporter_delegate_up =
3637
3637
std::make_unique<SwiftDWARFImporterDelegate>(*this );
3638
3638
auto importer_diags = getScopedDiagnosticConsumer ();
3639
+ const bool ignore_file_mapping = false ;
3640
+ const bool prefer_serialized_bridging_header = true ;
3639
3641
clang_importer_ap = swift::ClangImporter::create (
3640
3642
*m_ast_context_ap, " " , m_dependency_tracker.get (),
3641
- m_dwarfimporter_delegate_up.get ());
3643
+ m_dwarfimporter_delegate_up.get (), ignore_file_mapping,
3644
+ prefer_serialized_bridging_header);
3642
3645
3643
3646
// Handle any errors.
3644
3647
if (!clang_importer_ap || importer_diags->HasErrors ()) {
Original file line number Diff line number Diff line change
1
+ SWIFT_SOURCES := main.swift
2
+ SWIFT_ENABLE_EXPLICIT_MODULES := Yes
3
+ SWIFT_BRIDGING_HEADER := bridging.h
4
+ SWIFTFLAGS_EXTRAS = -Xcc -I$(BUILDDIR ) /secret
5
+
6
+ all : secret.h $(EXE )
7
+
8
+ include Makefile.rules
9
+
10
+ .PHONY : secret.h
11
+
12
+ secret.h :
13
+ mkdir -p $(BUILDDIR ) /secret
14
+ echo " struct S { int i; };" > $(BUILDDIR ) /secret/secret.h
Original file line number Diff line number Diff line change
1
+ import lldb
2
+ from lldbsuite .test .decorators import *
3
+ import lldbsuite .test .lldbtest as lldbtest
4
+ import lldbsuite .test .lldbutil as lldbutil
5
+
6
+
7
+ class TestSwiftExplicitModules (lldbtest .TestBase ):
8
+ NO_DEBUG_INFO_TESTCASE = True
9
+ @swiftTest
10
+ def test (self ):
11
+ """Test explicit Swift modules with bridging headers"""
12
+ self .build ()
13
+ secret = self .getBuildArtifact ("secret" )
14
+ import shutil
15
+ shutil .rmtree (secret )
16
+
17
+ target , process , thread , bkpt = lldbutil .run_to_source_breakpoint (
18
+ self , 'Set breakpoint here' , lldb .SBFileSpec ('main.swift' ))
19
+ log = self .getBuildArtifact ("types.log" )
20
+ self .expect ('log enable lldb types -f "%s"' % log )
21
+
22
+ self .expect ("expression s" , substrs = ['i = 23' ])
23
+ self .filecheck ('platform shell cat "%s"' % log , __file__ )
24
+ # CHECK: LogConfiguration
25
+ # CHECK-NOT: secret
26
+ # CHECK: Import
Original file line number Diff line number Diff line change
1
+ #include "secret.h"
Original file line number Diff line number Diff line change
1
+ func main( ) {
2
+ let s = S ( i: 23 )
3
+ print ( s) // Set breakpoint here
4
+ }
5
+
6
+ main ( )
You can’t perform that action at this time.
0 commit comments