From ea6fae3cb6f5ce01ce853f815e114e5421009f38 Mon Sep 17 00:00:00 2001 From: Alex Denisov Date: Thu, 14 Sep 2023 11:33:10 +0200 Subject: [PATCH 1/2] Swift 5.9: drop unused patch --- patches/swift/handle-empty-pattern-list.patch | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 patches/swift/handle-empty-pattern-list.patch diff --git a/patches/swift/handle-empty-pattern-list.patch b/patches/swift/handle-empty-pattern-list.patch deleted file mode 100644 index 2010ee8..0000000 --- a/patches/swift/handle-empty-pattern-list.patch +++ /dev/null @@ -1,19 +0,0 @@ -`PatternBindingDecl::getPatternList()` can in some cases return an empty list, which causes a -segmentation fault when getting the source range. This case needs to be handled for the extractor. - -diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp -index 75b99a22e73..09115678a82 100644 ---- a/lib/AST/Decl.cpp -+++ b/lib/AST/Decl.cpp -@@ -1725,7 +1725,10 @@ StringRef PatternBindingEntry::getInitStringRepresentation( - - SourceRange PatternBindingDecl::getSourceRange() const { - SourceLoc startLoc = getStartLoc(); -- SourceLoc endLoc = getPatternList().back().getSourceRange().End; -+ SourceLoc endLoc = startLoc; -+ if (!getPatternList().empty()) { -+ endLoc = getPatternList().back().getSourceRange().End; -+ } - if (startLoc.isValid() != endLoc.isValid()) return SourceRange(); - return { startLoc, endLoc }; - } From 6ece629ed21a3390a27ba1dce1a64392a2e8f30b Mon Sep 17 00:00:00 2001 From: Alex Denisov Date: Fri, 3 Nov 2023 13:15:21 +0100 Subject: [PATCH 2/2] Do not export toolchain --- pkg_swift_llvm.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkg_swift_llvm.py b/pkg_swift_llvm.py index 18543bc..a6f8e51 100755 --- a/pkg_swift_llvm.py +++ b/pkg_swift_llvm.py @@ -136,11 +136,6 @@ def export_sdk(tgt, swift_source_tree, swift_build_tree): ignore=shutil.ignore_patterns('CMakeLists.txt')) -def export_toolchain(tgt, toolchain_dir): - print("assembling toolchain") - shutil.copytree(toolchain_dir, tgt) - - def export_stdlibs(exported_dir, swift_build_tree): ext = 'dylib' platform = 'linux' if get_platform() == 'linux' else 'macosx' @@ -195,7 +190,6 @@ def main(opts): os.mkdir(tmp) llvm_build_tree = next(opts.build_tree.glob("llvm-*")) swift_build_tree = next(opts.build_tree.glob("swift-*")) - toolchain_dir = next(opts.build_tree.glob("toolchain-*/codeql-toolchain")) earlyswiftsyntax_build_tree = next(opts.build_tree.glob("earlyswiftsyntax-*")) configured = configure_dummy_project(tmp, prefixes=[llvm_build_tree, swift_build_tree, earlyswiftsyntax_build_tree / "cmake" / "modules"]) @@ -206,7 +200,6 @@ def main(opts): export_libs(exported, libs, swift_build_tree) export_headers(exported, opts.swift_source_tree, llvm_build_tree, swift_build_tree) export_sdk(exported / "sdk", opts.swift_source_tree, swift_build_tree) - export_toolchain(exported / "toolchain", toolchain_dir) zip_dir(exported, opts.output)