Skip to content

Commit 7ebb59f

Browse files
authored
Merge pull request #1857 from apple/glessard-patch-1
Update 0379-opt-in-reflection-metadata.md
2 parents 3f984e6 + 7593ddc commit 7ebb59f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

proposals/0379-opt-in-reflection-metadata.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ A developer has two ways right now - either
3333
1. To just in case enable Reflection in full.
3434
2. To try to guess which used APIs consume Reflection, and enable it only for modules that are users of such APIs.
3535

36-
Both of those options have flaws. The first one leads to exsessive contribution of reflection metadta to binary size and might affects the secrecy of generated code.
36+
Both of those options have flaws. The first one leads to excessive contribution of reflection metadata to binary size and might affects the secrecy of generated code.
3737
The second one isn't safe because many APIs are black boxes if the guess is wrong, an app might behave not as expected at runtime.
3838

3939
Furthermore, APIs can use Reflection Metadata differently. Some like `print`, `debugPrint`, and `dump` will still work with disabled reflection, but the output will be limited.
@@ -47,11 +47,11 @@ If for some reason a user module was compiled with metadata generation disabled,
4747
between state and representation which will make such API less safe since it becomes a runtime issue rather than a compile-time one.
4848

4949
On the other hand, excessive Reflection metadata may be preserved in a binary even if not used, because there is currently no way to statically determine its usage.
50-
There was an attempt to limit the amount of unused reflection metadata by improving its stripability by the Dead Code Elimination LLVM pass, but in many cases,
51-
it’s still preserved in the binary because it’s referenced by Full Type Metadata which prevents Reflection Metadata from stripping.
50+
There was an attempt to limit the amount of unused reflection metadata by improving the Dead Code Elimination LLVM pass, but in many cases
51+
it’s still preserved in the binary because it’s referenced by Full Type Metadata. This prevents Reflection Metadata from being stripped.
5252
This unnecessarily increases the binary size and may simplify reverse-engineering.
5353

54-
Introducing a static compilation check can help to solve both of mentioned issues by adding to the language a way to express the requirement to have Reflection metadata at runtime.
54+
Introducing a static compilation check can help to solve both of mentioned issues by adding to the language a way to express the requirement to have Reflection metadata available at runtime.
5555

5656

5757
## Proposed solution
@@ -163,7 +163,7 @@ consume(Bar())
163163
Since Reflection metadata might be used by the debugger, we propose to always keep that metadata
164164
if full emission of debugging information is enabled (with `-gdwarf-types` or `-g` flags).
165165
However, such Reflection metadata won't be accessible through the nominal type descriptor
166-
which will allow to avoid inconsistencies between APIs' outputs in Release and Debug modes.
166+
which will avoid inconsistencies in API behavior between Release and Debug modes.
167167

168168
### Changes in flags
169169

0 commit comments

Comments
 (0)