Skip to content
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

[Sema] Add -fvisibility-global-new-delete= option #75364

Merged
merged 1 commit into from
Jan 22, 2024

Commits on Jan 21, 2024

  1. [Sema] Add -fvisibility-global-new-delete= option

    By default the implicitly declared replaceable global new and delete
    operators are given a default visibility attribute. Previous work, see:
    https://reviews.llvm.org/D53787, added
    `-fvisibility-global-new-delete-hidden` to change this to a hidden
    visibility attribute.
    
    This change adds `-fvisibility-global-new-delete=` which controls
    whether (or not) to add an implicit visibility attribute to the implicit
    declarations for these functions, and what visibility that attribute
    will specify. The option takes 4 values: `force-hidden`,
    `force-protected`, `force-default` and `source`. Option values
    `force-hidden`, `force-protected` and `force-default` assign hidden,
    protected, and default visibilities respectively; the use of the term
    force in the value names is designed to imply to a user that the semantics
    of this option differ significantly from `-fvisibility=`. An option
    value of `source` implies that no implicit attribute is added; without
    the attribute the replaceable global new and delete operators behave
    normally (like other functions) with respect to visibility attributes,
    pragmas and options.
    
    The motivation for the `source` value is to facilitate users who intend
    to replace these functions either for a single linkage unit or a limited
    set of linkage units. `-fvisibility-global-new-delete=source` can be
    applied globally to the compilations in a build where the existing
    `-fvisibility-global-new-delete-hidden` cannot, as it conflicts with a
    common pattern where these functions are dynamically imported.
    
    The existing `-fvisibility-global-new-delete-hidden` is now a deprecated
    spelling of `-fvisibility-global-new-delete=force-hidden`
    
    A release note has been added for these changes.
    
    `-fvisibility-global-new-delete=source` will be set by default for PS5.
    PS5 users that want the normal toolchain behaviour will be able to
    supply `-fvisibility-global-new-delete=force-default`.
    bd1976bris committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    dc60cb2 View commit details
    Browse the repository at this point in the history