This involves teaching the constant folder to look through a borrow when trying
to find the string literal. I also added an additional run with ownership
lowering after diagnostics enabled to make sure this doesn't break again.
"globalStringTablePointer": String -> Builtin.RawPointer` to a
string_literal instruction if the string that is passed is constructed
from a literal. Otherwise, emit diagnostics.
For context, String, Nil, and Bool already behave this way.
Note: Before it used to construct (call, ... (integer_literal)), and the
call would be made explicit / implicit based on if you did eg: Int(3) or
just 3. This however did not translate to the new world so this PR adds
a IsExplicitConversion bit to NumberLiteralExpr. Some side results of
all this are that some warnings changed a little and some instructions are
emitted in a different order.
integer protocols changed the way basic arithmetic operations were
called. <rdar://29939484> has more information.
This commit re-enables those tests and updates the SIL that was checked
in the tests to be consistent with the one generated by the current
compiler.
<rdar://29939484>
"Extend test/SILPasses/diagnostic_constant_propagation.swift" by removing
tests from the file that referred to `Int` and `UInt` types.
These tests are dependent on the word length of the architecture and
are covered by the tests in the files
`diagnostic_constant_propagation_int_archXX.swift`.
Also, this commit corrects erroneous references to a radar problem
in the test suties: `diagnostic_constant_propagation_int_archXX.swift`
This commit enables many parts of the test suite `diagnostic_constant_propagation.swift`.
These tests were disabled as they failed due to changes to the implementation of integer
initializers, which made them non-transparent. The current modification enables all test
cases that pass under the latest swift implementation. It also has some false negatives,
which should ideally be reported as an error but currently pass the diagnostics phase.
The commit also extracts the tests that have diverging behavior in Swift 3 and Swift 4
into separate test files.