Introduce the SIL instruction alloc_ref_dynamic.

alloc_ref_dynamic allocates an instance of a class type based on the
value in its metatype operand. Start emitting these instructions for
the allocating constructor of a complete object initializer (not yet
tested) and for the allocating constructor synthesized for an imported
Objective-C init method.

Still missing:
  - IRGen still does the same thing as alloc_ref right now. That
  change will follow.
  - There are devirtualization opportunities when we know the value of
  the metatype that would turn an alloc_ref_dynamic into an alloc_ref;
  I'm not planning to do this optimization.



Swift SVN r14560
This commit is contained in:
Doug Gregor
2014-03-01 21:55:50 +00:00
parent 054e844f70
commit 5d8bd84dfa
18 changed files with 172 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ const uint16_t VERSION_MAJOR = 0;
/// Serialized module format minor version number.
///
/// When the format changes IN ANY WAY, this number should be incremented.
const uint16_t VERSION_MINOR = 11;
const uint16_t VERSION_MINOR = 12;
using DeclID = Fixnum<31>;
using DeclIDField = BCFixed<31>;