Assign built-in function return type in promote()

This finishes the refactoring of unary math operation handling so that
IntermUnary::promote has the complete code for setting the return type of
the node.

BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests

Change-Id: I19bd8d53029e24f734c9436eceb446b37e7fcf26
Reviewed-on: https://chromium-review.googlesource.com/262416
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/Intermediate.cpp b/src/compiler/translator/Intermediate.cpp
index b72a2bf..320056f 100644
--- a/src/compiler/translator/Intermediate.cpp
+++ b/src/compiler/translator/Intermediate.cpp
@@ -127,7 +127,7 @@
 // Returns the added node.
 //
 TIntermTyped *TIntermediate::addUnaryMath(
-    TOperator op, TIntermTyped *child, const TSourceLoc &line)
+    TOperator op, TIntermTyped *child, const TSourceLoc &line, const TType *funcReturnType)
 {
     TIntermConstantUnion *childTempConstant = 0;
     if (child->getAsConstantUnion())
@@ -139,7 +139,7 @@
     TIntermUnary *node = new TIntermUnary(op);
     node->setLine(line);
     node->setOperand(child);
-    node->promote();
+    node->promote(funcReturnType);
 
     if (childTempConstant)
     {