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
File | Mode | Size |
---|---|---|
cmake | ||
cxx-source | ||
multi-source | ||
scripts | ||
single-source | ||
utils | ||
CMakeLists.txt | -rw-r--r-- | 12.2 KB |
Naming.md | -rw-r--r-- | 5.5 KB |
Package.swift | -rw-r--r-- | 6.3 KB |
README.md | -rw-r--r-- | 12.9 KB |
Computing file changes ...