Skip to content

Parameterize Initialization of clang::CodeGenerator on a TargetInfo instance which may differ from the one in the ASTContext #7916

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
Oct 24, 2024

Conversation

artemcm
Copy link

@artemcm artemcm commented Dec 20, 2023

As per swiftlang/swift#65930, Swift compiler's built-in Clang instance may require to perform type-checking against one OS version and compilation/code-generation against an earlier version. This change allows Swift to configure it's built-in Clang code-generator with a custom TargetInfo:
swiftlang/swift#70564

Part of rdar://113712186

@artemcm
Copy link
Author

artemcm commented Mar 5, 2024

@swift-ci test

@artemcm artemcm requested a review from Bigcheese March 5, 2024 22:45
@artemcm
Copy link
Author

artemcm commented Mar 13, 2024

ping @Bigcheese

@artemcm
Copy link
Author

artemcm commented Mar 13, 2024

@swift-ci test

@artemcm
Copy link
Author

artemcm commented Sep 16, 2024

@swift-ci test

Copy link

@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.

Some comments. I feel like the added parameter is very hard to use, while I don't have better options for now.

… instance which may differ from the one in the ASTContext

As per swiftlang/swift#65930, Swift compiler's built-in Clang instance may require to perform type-checking against one OS version and compilation/code-generation against an earlier version. This change allows Swift to configure it's built-in Clang code-generator with a custom 'TargetInfo'.

Part of rdar://113712186
@artemcm artemcm force-pushed the artemcm/ExplicitBuildClangTargetIRGen branch from a996f0a to 4c63c4c Compare October 21, 2024 21:11
@artemcm
Copy link
Author

artemcm commented Oct 21, 2024

@swift-ci test

@artemcm
Copy link
Author

artemcm commented Oct 22, 2024

ping

Copy link

@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

@artemcm artemcm merged commit f4b733c into stable/20230725 Oct 24, 2024
3 checks passed
@artemcm artemcm deleted the artemcm/ExplicitBuildClangTargetIRGen branch October 24, 2024 16:45
artemcm added a commit that referenced this pull request Apr 25, 2025
…form version

Similarly to 'CheckAvailability' and 'getAvailability', set 'Decl::isWeakImported' to allow querying using an external target platform version.

In #7916 we have added support for configuring 'clang::CodeGenerator' with a differently-versioned target info, and this change adopts the code generator's target info in order to also determine weakly-imported linkage on declarations during code-gen. Before this change, they were relying on the 'ASTContext' to specify the target info, which may differ from code-gen's.
artemcm added a commit that referenced this pull request Apr 28, 2025
…form version

Similarly to 'CheckAvailability' and 'getAvailability', set 'Decl::isWeakImported' to allow querying using an external target platform version.

In #7916 we have added support for configuring 'clang::CodeGenerator' with a differently-versioned target info, and this change adopts the code generator's target info in order to also determine weakly-imported linkage on declarations during code-gen. Before this change, they were relying on the 'ASTContext' to specify the target info, which may differ from code-gen's.
artemcm added a commit that referenced this pull request Apr 28, 2025
…form version

Similarly to 'CheckAvailability' and 'getAvailability', set 'Decl::isWeakImported' to allow querying using an external target platform version.

In #7916 we have added support for configuring 'clang::CodeGenerator' with a differently-versioned target info, and this change adopts the code generator's target info in order to also determine weakly-imported linkage on declarations during code-gen. Before this change, they were relying on the 'ASTContext' to specify the target info, which may differ from code-gen's.
artemcm added a commit that referenced this pull request Apr 28, 2025
…form version

Similarly to 'CheckAvailability' and 'getAvailability', set 'Decl::isWeakImported' to allow querying using an external target platform version.

In #7916 we have added support for configuring 'clang::CodeGenerator' with a differently-versioned target info, and this change adopts the code generator's target info in order to also determine weakly-imported linkage on declarations during code-gen. Before this change, they were relying on the 'ASTContext' to specify the target info, which may differ from code-gen's.
artemcm added a commit that referenced this pull request Apr 29, 2025
…form version

Similarly to 'CheckAvailability' and 'getAvailability', set 'Decl::isWeakImported' to allow querying using an external target platform version.

In #7916 we have added support for configuring 'clang::CodeGenerator' with a differently-versioned target info, and this change adopts the code generator's target info in order to also determine weakly-imported linkage on declarations during code-gen. Before this change, they were relying on the 'ASTContext' to specify the target info, which may differ from code-gen's.
artemcm added a commit that referenced this pull request Apr 29, 2025
…form version

Similarly to 'CheckAvailability' and 'getAvailability', set 'Decl::isWeakImported' to allow querying using an external target platform version.

In #7916 we have added support for configuring 'clang::CodeGenerator' with a differently-versioned target info, and this change adopts the code generator's target info in order to also determine weakly-imported linkage on declarations during code-gen. Before this change, they were relying on the 'ASTContext' to specify the target info, which may differ from code-gen's.
artemcm added a commit that referenced this pull request Apr 29, 2025
…form version

Similarly to 'CheckAvailability' and 'getAvailability', set 'Decl::isWeakImported' to allow querying using an external target platform version.

In #7916 we have added support for configuring 'clang::CodeGenerator' with a differently-versioned target info, and this change adopts the code generator's target info in order to also determine weakly-imported linkage on declarations during code-gen. Before this change, they were relying on the 'ASTContext' to specify the target info, which may differ from code-gen's.
artemcm added a commit that referenced this pull request Apr 29, 2025
…form version

Similarly to 'CheckAvailability' and 'getAvailability', set 'Decl::isWeakImported' to allow querying using an external target platform version.

In #7916 we have added support for configuring 'clang::CodeGenerator' with a differently-versioned target info, and this change adopts the code generator's target info in order to also determine weakly-imported linkage on declarations during code-gen. Before this change, they were relying on the 'ASTContext' to specify the target info, which may differ from code-gen's.
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