diff --git a/include/swift/Basic/Dwarf.h b/include/swift/Basic/Dwarf.h index 16e06123f5470..2c6f12dbc7789 100644 --- a/include/swift/Basic/Dwarf.h +++ b/include/swift/Basic/Dwarf.h @@ -23,8 +23,8 @@ namespace swift { /// The DWARF version emitted by the Swift compiler. const unsigned DWARFVersion = 4; - static const char MachOASTSegmentName[] = "__SWIFT"; - static const char MachOASTSectionName[] = "__ast"; + static const char MachOASTSegmentName[] = "__DWARF"; + static const char MachOASTSectionName[] = "__swift_ast"; static const char ELFASTSectionName[] = ".swift_ast"; static const char COFFASTSectionName[] = "swiftast"; static const char WasmASTSectionName[] = ".swift_ast"; diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index 21a400c8f3213..ca88f2efaccff 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -1364,6 +1364,10 @@ swift::createSwiftModuleObjectFile(SILModule &SILMod, StringRef Buffer, assert(!Ctx.hadError()); IRGenOptions Opts; + // This tool doesn't pass the necessary runtime library path to + // TypeConverter, because this feature isn't needed. + Opts.DisableLegacyTypeInfo = true; + Opts.OutputKind = IRGenOutputKind::ObjectFile; IRGenerator irgen(Opts, SILMod); diff --git a/test/DebugInfo/ASTSection-single.swift b/test/DebugInfo/ASTSection-single.swift new file mode 100644 index 0000000000000..95f1f05578b92 --- /dev/null +++ b/test/DebugInfo/ASTSection-single.swift @@ -0,0 +1,14 @@ +// REQUIRES: executable_test +// REQUIRES: swift_tools_extra + +// Test that a module-wrapped Swift AST section can be parsed. + +// RUN: %empty-directory(%t) + +// RUN: echo "public let a0 = 0" >%t/a0.swift +// RUN: %target-build-swift %t/a0.swift -emit-module -emit-module-path %t/a0.swiftmodule +// RUN: %target-swift-modulewrap %t/a0.swiftmodule -o %t/a0-mod.o + +// RUN: %lldb-moduleimport-test -verbose %t/a0-mod.o | %FileCheck %s +// CHECK: Importing a0... ok! + diff --git a/test/DebugInfo/ASTSection_linker.swift b/test/DebugInfo/ASTSection_linker.swift index 7fbf987b8ad0f..bf49622056913 100644 --- a/test/DebugInfo/ASTSection_linker.swift +++ b/test/DebugInfo/ASTSection_linker.swift @@ -6,7 +6,7 @@ // RUN: %swift-ide-test -test-CompilerInvocation-from-module -source-filename=%t/ASTSection.swiftmodule // Test the inline section mechanism. -// RUN: %target-ld %t/ASTSection.o -sectcreate __SWIFT __ast %t/ASTSection.swiftmodule -o %t/ASTSection.dylib -dylib -lSystem -lobjc +// RUN: %target-ld %t/ASTSection.o -sectcreate __DWARF __swift_ast %t/ASTSection.swiftmodule -o %t/ASTSection.dylib -dylib -lSystem -lobjc // RUN: %lldb-moduleimport-test -verbose %t/ASTSection.dylib | %FileCheck %s // Test the symbol table entry.