Revision 1437acdf22ecb997b43a23a89c9249ca0b0ac676 authored by John McCall on 01 March 2024, 06:39:35 UTC, committed by John McCall on 02 March 2024, 03:10:14 UTC
Our standard conception of suppressible features assumes we should
always suppress the feature if the compiler doesn't support it.
This presumes that there's no harm in suppressing the feature, and
that's a fine assumption for features that are just adding information
or suppressing new diagnostics.  Features that are semantically
relevant, maybe even ABI-breaking, are not a good fit for this,
and so instead of reprinting the decl with the feature suppressed,
we just have to hide the decl entirely.  The missing middle here
is that it's sometimes useful to be able to adopt a type change
to an existing declaration, and we'd like older compilers to be
able to use the older version of the declaration.  Making a type
change this way is, of course, only really acceptable for
@_alwaysEmitIntoClient declarations; but those represent quite a
few declarations that we'd like to be able to refine the types of.

Rather than trying to come up with heuristics based on
@_alwaysEmitIntoClient or other sources of information, this design
just requires the declaration to opt in with a new attribute,
@_allowFeatureSuppress.  When a declaration opts in to suppression
for a conditionally-suppressible feature, the printer uses the
suppression serially-print-with-downgraded-options approach;
otherwise it uses the print-only-if-feature-is-available approach.
1 parent 976f149
History
File Mode Size
.github
SwiftCompilerSources
apinotes
benchmark
bindings
cmake
docs
include
lib
localization
stdlib
test
tools
unittests
userdocs
utils
validation-test
.clang-format -rw-r--r-- 57 bytes
.clang-tidy -rw-r--r-- 294 bytes
.dir-locals.el -rw-r--r-- 1.5 KB
.flake8 -rw-r--r-- 1.9 KB
.gitattributes -rw-r--r-- 88 bytes
.gitignore -rw-r--r-- 2.2 KB
.mailmap -rw-r--r-- 8.3 KB
Brewfile -rw-r--r-- 41 bytes
CHANGELOG.md -rw-r--r-- 355.0 KB
CMakeLists.txt -rw-r--r-- 52.6 KB
CODE_OF_CONDUCT.md -rw-r--r-- 199 bytes
CODE_OWNERS.TXT -rw-r--r-- 1.7 KB
CONTRIBUTING.md -rw-r--r-- 542 bytes
LICENSE.txt -rw-r--r-- 11.5 KB
README.md -rw-r--r-- 9.1 KB

README.md

back to top