mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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 ['=', '*=', '/=', '%=', '+=', '-=']
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user