Skip to content

[DNM] [rebranch] Correct nullability of free() redeclaration #35391

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

Closed
wants to merge 2 commits into from

Conversation

beccadax
Copy link
Contributor

In the new clang, this declaration ends up influencing the redeclaration chain, altering the nullability of the free(_:) function imported into Swift.

Fixes rdar://71269128. Note that tests may fail unless a clean build is performed.

I'm not yet certain whether I will merge this to rebranch or to main, but I know that I want a PR test against rebranch.

In the new clang, this declaration ends up influencing the redeclaration chain, altering the nullability of the `free(_:)` function imported into Swift.

Fixes rdar://71269128. Note that tests may fail unless a clean build is performed.
@beccadax
Copy link
Contributor Author

@swift-ci please smoke test

@beccadax beccadax marked this pull request as draft January 13, 2021 00:38
@beccadax
Copy link
Contributor Author

19:35:26 
/home/buildnode/jenkins/workspace/swift-PR-Linux-smoke-test@2/branch-rebranch/swift/lib/IRGen/GenCall.cpp:496:35: error: no member named 'SwiftAsync' in 'llvm::Attribute'
19:35:26   b.addAttribute(llvm::Attribute::SwiftAsync);
19:35:26                  ~~~~~~~~~~~~~~~~~^
19:35:26 /home/buildnode/jenkins/workspace/swift-PR-Linux-smoke-test@2/branch-rebranch/swift/lib/IRGen/GenCall.cpp:1538:33: error: no member named 'SwiftAsyncContext' in 'clang::ParameterABI'; did you mean 'SwiftContext'?
19:35:26       case clang::ParameterABI::SwiftAsyncContext:
19:35:26            ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
19:35:26                                 SwiftContext
19:35:26 /home/buildnode/jenkins/workspace/swift-PR-Linux-smoke-test@2/branch-rebranch/llvm-project/clang/include/clang/Basic/Specifiers.h:347:5: note: 'SwiftContext' declared here
19:35:26     SwiftContext
19:35:26     ^
19:35:26 /home/buildnode/jenkins/workspace/swift-PR-Linux-smoke-test@2/branch-rebranch/swift/lib/IRGen/GenCall.cpp:1541:12: error: duplicate case value 'SwiftContext'
19:35:26       case clang::ParameterABI::SwiftContext:
19:35:26            ^
19:35:26 /home/buildnode/jenkins/workspace/swift-PR-Linux-smoke-test@2/branch-rebranch/swift/lib/IRGen/GenCall.cpp:1538:12: note: previous case defined here
19:35:26       case clang::ParameterABI::SwiftAsyncContext:
19:35:26            ^

Failure is unrelated.

@beccadax
Copy link
Contributor Author

Added a revert commit which should work around that failure.

@swift-ci please smoke test

@beccadax
Copy link
Contributor Author

@swift-ci please smoke test

@beccadax
Copy link
Contributor Author

We're hitting unrelated bugs in the LLDB configuration, which prevent us from getting useful results from PR tests.

In local testing, I observed that:

  • stdlib/TestData.swift passes
  • llbuildSwift still fails to compile, but it fails by crashing in IRGen, not by a use of free(_:) failing to typecheck.

On this basis, I believe this change is good and should be merged to main branch.

@beccadax beccadax closed this Jan 14, 2021
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.

1 participant