Skip to content

[6.1] Sema: don't use llvm::StringSwitch for runtime function names #79472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Feb 18, 2025

Using llvm::StringSwitch with this many cases causes clang to crash due to a stack overflow. Works around rdar://143944155

(cherry picked from commit ed4863f)

--- CCC ---

Explanation: clang 16.0 is often used to build release branches but crashes with infinite recursion when compiling TypeCheckAttr.cpp with asserts enabled. We need an asserts compiler to debug Swift 6.1 issues.

Scope: No functional change. This is a syntax workaround to avoid crashing clang.

Radar/SR Issue: rdar://143944155 (clang crashes compiling TypeCheckAttr.cpp when building the swift compiler: infinite recursion in EmitCXXConstructorCall)

Original PR: #79109

Risk: Minimal

Testing: clang 16.0 successfully builds

Reviewer: Pavel Yaskevich

@atrick atrick added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.1 labels Feb 18, 2025
@atrick atrick requested review from xedin and eeckstein February 18, 2025 21:42
@atrick atrick requested a review from a team as a code owner February 18, 2025 21:42
@atrick
Copy link
Contributor Author

atrick commented Feb 18, 2025

@swift-ci test

Using `llvm::StringSwitch` with this many cases causes clang to crash due to a stack overflow.
Works around rdar://143944155

(cherry picked from commit ed4863f)
@xedin xedin force-pushed the fix-typecheckattr branch from 44dd4df to 922f7b1 Compare February 19, 2025 22:43
@xedin
Copy link
Contributor

xedin commented Feb 19, 2025

@swift-ci please test

@atrick atrick merged commit 5134191 into swiftlang:release/6.1 Feb 21, 2025
5 checks passed
@atrick atrick deleted the fix-typecheckattr branch February 21, 2025 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants