SIL: Add an allowed access kind to the opened value of an open_existential_addr instruction

Once we move to a copy-on-write implementation of existential value buffers we
can no longer consume or destroy values of an opened existential unless the
buffer is uniquely owned.

Therefore we need to track the allowed operation on opened values.

Add qualifiers "mutable_access" and "immutable_access" to open_existential_addr
instructions to indicate the allowed access to the opened value.

Once we move to a copy-on-write implementation, an "open_existential_addr
mutable_access" instruction will ensure unique ownership of the value buffer.
This commit is contained in:
Arnold Schwaighofer
2017-01-27 15:35:33 -08:00
parent ec802fe9cd
commit 876cea81ae
43 changed files with 195 additions and 101 deletions

View File

@@ -54,8 +54,7 @@ const uint16_t VERSION_MAJOR = 0;
/// in source control, you should also update the comment to briefly
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
const uint16_t VERSION_MINOR = 317; // Last change: search path options record
// if it is system or not.
const uint16_t VERSION_MINOR = 318; // Last change: SIL open_exist. access kind
using DeclID = PointerEmbeddedInt<unsigned, 31>;
using DeclIDField = BCFixed<31>;