Skip to content

Conversation

@rintaro
Copy link
Member

@rintaro rintaro commented Nov 16, 2023

Cherry-pick #69838 and #69930 into release/5.10

  • Explanation: Support regular expression literal in Windows. ASTGen always builds with the host Swift compiler, without requiring bootstrapping, and is enabled in more places. Move the regex literal parsing logic there so it is enabled in more host environments including Windows, and makes use of CMake's Swift support. Also this includes an important CMake fix for Windows; previously, swift-frontend wasn't linked with swiftrt.obj, that may caused numerous unexpected issues.
  • Scope: Regex literal parsing
  • Risk: Mid. This also changes the build mechanism of the regex literal parsing logic in other platforms. But that mechanism is well established and tested with Macros support.
  • Testing: Enabled all of the regex literal tests when ASTGen is built, to ensure everything is working.
  • Issues: rdar://118534766
  • Reviewers: Doug Gregor (@DougGregor), Hamish Knight (@hamishknight)

ASTGen always builds with the host Swift compiler, without requiring
bootstrapping, and is enabled in more places. Move the regex literal
parsing logic there so it is enabled in more host environments, and
makes use of CMake's Swift support. Enable all of the regex literal
tests when ASTGen is built, to ensure everything is working.

Remove the "AST" and "Parse" Swift modules from SwiftCompilerSources,
because they are no longer needed.

(cherry picked from commit 47f18d4)

 Conflicts:
	SwiftCompilerSources/CMakeLists.txt
	SwiftCompilerSources/Sources/AST/DiagnosticEngine.swift
	SwiftCompilerSources/Sources/Optimizer/PassManager/Context.swift
	SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift
	include/swift/Bridging/ASTGen.h
	lib/ASTGen/Package.swift
	lib/ASTGen/Sources/ASTGen/Bridge.swift
	lib/ASTGen/Sources/ASTGen/Regex.swift
	lib/Parse/Lexer.cpp
	lib/Parse/ParseRegex.cpp
swiftrt.obj is required for making things work

(cherry picked from commit abd4164)
HeaderDependencies.cpp and the stdlib filelist didn't have dependencies.
That causes issues when the content is changed.

(cherry picked from commit f327bf7)
This is not used anymore

(cherry picked from commit 986415a)

 Conflicts:
	include/swift/Parse/RegexParserBridging.h
	lib/ASTGen/Sources/ASTGen/Regex.swift
@rintaro rintaro requested a review from a team as a code owner November 16, 2023 23:38
@rintaro
Copy link
Member Author

rintaro commented Nov 16, 2023

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Nov 17, 2023

@swift-ci Please Build Toolchain

@rintaro
Copy link
Member Author

rintaro commented Nov 17, 2023

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Nov 17, 2023

@swift-ci Please Build Toolchain

_Nonnull is not a thing in Windows `cl.exe`. Since it's not needed in
C++, just remove it.
@rintaro
Copy link
Member Author

rintaro commented Nov 17, 2023

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Nov 17, 2023

@swift-ci Please Build Toolchain

Regex literal parsing is now built as a part of ASTGen, that requires
host toolchain and swift-syntax integration.

(cherry picked from commit ee982fd)
@rintaro
Copy link
Member Author

rintaro commented Nov 27, 2023

@swift-ci Please test

@rintaro rintaro merged commit c6477a5 into swiftlang:release/5.10 Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants