Skip to content

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Jul 10, 2024

The scanning action does not have any need for handling -llvm options, since it will never perform any code-gen. LLVM option processing relies on global option parsing structures, and the scanner has needed to carefully attempt to synchronize access to them. This change guards the configuration of LLVM options to not happen at all for dependency scanning actions, and removes calls to llvm::cl::ResetAllOptionOccurrences() that were previously needed.

Resolves rdar://120754696

… by the scanner

The scanning action does not have any need for handling `-llvm` options, since it will never perform any code-gen. LLVM option processing relies on global option parsing structures, and the scanner has needed to carefully attempt to synchronize access to them. This change guards the configuration of LLVM options to not happen at all for dependency scanning actions, and removes calls to `llvm::cl::ResetAllOptionOccurrences()` that were previously needed.

Resolves rdar://120754696
@artemcm artemcm requested a review from tshortli as a code owner July 10, 2024 21:41
@artemcm
Copy link
Contributor Author

artemcm commented Jul 10, 2024

@swift-ci test

Copy link
Contributor

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It seems the in process version of swift-frontend in scanner is going to hit this too right? That is a different problem entirely.

@artemcm
Copy link
Contributor Author

artemcm commented Jul 10, 2024

LGTM. It seems the in process version of swift-frontend in scanner is going to hit this too right? That is a different problem entirely.

Do you mean swift-frontend -scan-dependencies ... invocations? Yes, this change will apply to those as well, but I do not think such invocations should be affected by -llvm options either.

@cachemeifyoucan
Copy link
Contributor

LGTM. It seems the in process version of swift-frontend in scanner is going to hit this too right? That is a different problem entirely.

Do you mean swift-frontend -scan-dependencies ... invocations? Yes, this change will apply to those as well, but I do not think such invocations should be affected by -llvm options either.

No, I mean invoke_swift_compiler API in libSwiftScan.

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.

3 participants