IntLiteral should prefer int32 during overload resolution
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Sep 2017 17:20:49 +0000 (17:20 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Sep 2017 17:20:49 +0000 (17:20 +0000)
commit0e3fe9643e2b7031e01ced06634af081a552c057
treea119dda14d9f2d29e6eb5d4f2690f0e8006f8189
parentdf7a6922f9f3c2ae5b208e399caa218b5ce152da
IntLiteral should prefer int32 during overload resolution
https://bugs.webkit.org/show_bug.cgi?id=176675

Reviewed by Myles Maxfield.

This makes intLiteralType prefer to resolve to int over other types.

This also adds tests that if you pass intLiteral to T, then you can make it work by saying
int(intLiteral).

* WebGPUShadingLanguageRI/IntLiteralType.js:
(IntLiteralType):
(IntLiteralType.prototype.conversionCost):
* WebGPUShadingLanguageRI/Node.js:
(Node.prototype.conversionCost):
* WebGPUShadingLanguageRI/ResolveOverloadImpl.js:
(resolveOverloadImpl):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitIntLiteralType):
* WebGPUShadingLanguageRI/Test.js:
(TEST_intOverloadResolution):
(TEST_intOverloadResolutionReverseOrder):
(TEST_intOverloadResolutionGeneric):
(TEST_intLiteralGeneric):
* WebGPUShadingLanguageRI/UnificationContext.js:
(UnificationContext.prototype.get conversionCost):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitIntLiteralType):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221860 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/WebGPUShadingLanguageRI/IntLiteralType.js
Tools/WebGPUShadingLanguageRI/Node.js
Tools/WebGPUShadingLanguageRI/ResolveOverloadImpl.js
Tools/WebGPUShadingLanguageRI/Rewriter.js
Tools/WebGPUShadingLanguageRI/Test.js
Tools/WebGPUShadingLanguageRI/UnificationContext.js
Tools/WebGPUShadingLanguageRI/Visitor.js