Skip to content

Commit bf41986

Browse files
Merge pull request #42498 from aschwaighofer/document_readonly_metadata_create
Document that we intentionally mark functions that create metadata as `readonly` such that they cannot be hoisted above availability checks
2 parents 45ec725 + 000495c commit bf41986

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/swift/Runtime/RuntimeFunctions.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
//
1616
// Runtime functions that read from object arguments cannot be marked
1717
// ReadNone. Otherwise the objects may be freed before the runtime call.
18+
// Runtime functions that instantiate metadata cannot be marked ReadNone
19+
// or else they could be moved out of blocks controlled by a availability check.
1820
//
1921
//===----------------------------------------------------------------------===//
2022

0 commit comments

Comments
 (0)