Replace PointerIntUnion with a PointerUnion-compatible Fixnum type.

Per discussion on swift-dev, we'd prefer to have a "pointer-like" integer
with limited bit width, to reuse all the existing infrastructure for
pointer-like types, rather than invent another new data structure.

Swift SVN r5529
This commit is contained in:
Jordan Rose
2013-06-08 00:18:19 +00:00
parent e4e1d635a2
commit c8958a232e
6 changed files with 195 additions and 92 deletions

View File

@@ -45,15 +45,17 @@ enum class DeclOrType {
IsType
};
// The serialized format uses 32 bits for potential alignment benefits, even
// though bitcode is generally unaligned.
using DeclID = Fixnum<31>;
using DeclIDField = BCFixed<32>;
using DeclID = DeclIDField::value_type;
// TypeID must be the same as DeclID because it is stored in the same way.
using TypeIDField = DeclIDField;
using TypeID = DeclID;
using TypeIDField = DeclIDField;
using BitOffset = Fixnum<31>;
using BitOffsetField = BCFixed<32>;
using BitOffset = BitOffsetField::value_type;
/// The various types of blocks that can occur within a serialized Swift