stdlib: use fixed-width Builtin.IntXX types for Swift.Int and UInt

Using the unknown-sized Builtin.Word types complicates producing
compile-time overflow diagnostics.  If we don't know the target Word
size, we don't know if there is an overflow.  But SIL optimizer does not
know the size of Word, this is the point of having the Word type in the
first place.

Also, this opens up more possibilities for optimizations.

rdar://17604532

Swift SVN r24788
This commit is contained in:
Dmitri Hrybenko
2015-01-28 05:22:42 +00:00
parent b15c0bd01c
commit ff771d0984
8 changed files with 578 additions and 47 deletions

View File

@@ -33,7 +33,7 @@ class SwiftIntegerType(object):
'Int' + \
('' if is_word else str(bits))
self.builtin_name = ('Word' if is_word else 'Int' + str(bits))
self.builtin_name = 'Int' + str(bits)
def get_opposite_signedness(self):
return SwiftIntegerType(self.is_word, self.bits, not self.is_signed)
@@ -102,4 +102,4 @@ def all_integer_assignment_operator_names():
def all_integer_or_real_assignment_operator_names():
return ['=', '*=', '/=', '%=', '+=', '-=']