Commit 5f438061 by Jamie Madill

Only set declaration operator if not already set.

This allows us to return different operators from single declarations, which will be useful for treating invariant declarations as different operators. BUG=angle:711 Change-Id: Id278b91854bbefe8e635380d7b27198198236fef Reviewed-on: https://chromium-review.googlesource.com/212939Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarNicolas Capens <capn@chromium.org>
parent 47e3ec08
......@@ -785,9 +785,10 @@ declaration
context->symbolTable.pop();
}
| init_declarator_list SEMICOLON {
if ($1.intermAggregate)
$1.intermAggregate->setOp(EOpDeclaration);
$$ = $1.intermAggregate;
TIntermAggregate *aggNode = $1.intermAggregate;
if (aggNode && aggNode->getOp() == EOpNull)
aggNode->setOp(EOpDeclaration);
$$ = aggNode;
}
| PRECISION precision_qualifier type_specifier_no_prec SEMICOLON {
if (($2 == EbpHigh) && (context->shaderType == GL_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
......
......@@ -802,25 +802,25 @@ static const yytype_uint16 yyrline[] =
544, 545, 553, 564, 568, 569, 579, 589, 599, 612,
613, 623, 636, 640, 644, 648, 649, 662, 663, 676,
677, 690, 691, 708, 709, 722, 723, 724, 725, 726,
730, 733, 744, 752, 760, 787, 792, 803, 807, 811,
815, 822, 878, 881, 888, 896, 917, 938, 948, 976,
981, 991, 996, 1006, 1009, 1012, 1015, 1021, 1028, 1031,
1035, 1039, 1043, 1050, 1054, 1058, 1065, 1069, 1073, 1081,
1090, 1096, 1099, 1105, 1111, 1118, 1127, 1136, 1144, 1147,
1154, 1158, 1165, 1168, 1172, 1176, 1185, 1194, 1202, 1212,
1224, 1227, 1230, 1236, 1243, 1246, 1252, 1255, 1258, 1264,
1267, 1282, 1286, 1290, 1294, 1298, 1302, 1307, 1312, 1317,
1322, 1327, 1332, 1337, 1342, 1347, 1352, 1357, 1362, 1367,
1372, 1377, 1382, 1387, 1392, 1397, 1402, 1407, 1411, 1415,
1419, 1423, 1427, 1431, 1435, 1439, 1443, 1447, 1451, 1455,
1459, 1463, 1467, 1475, 1483, 1487, 1500, 1500, 1503, 1503,
1509, 1512, 1528, 1531, 1540, 1544, 1550, 1557, 1572, 1576,
1580, 1581, 1587, 1588, 1589, 1590, 1591, 1595, 1596, 1596,
1596, 1606, 1607, 1611, 1611, 1612, 1612, 1617, 1620, 1630,
1633, 1639, 1640, 1644, 1652, 1656, 1666, 1671, 1688, 1688,
1693, 1693, 1700, 1700, 1708, 1711, 1717, 1720, 1726, 1730,
1737, 1744, 1751, 1758, 1769, 1778, 1782, 1789, 1792, 1798,
1798
730, 733, 744, 752, 760, 787, 793, 804, 808, 812,
816, 823, 879, 882, 889, 897, 918, 939, 949, 977,
982, 992, 997, 1007, 1010, 1013, 1016, 1022, 1029, 1032,
1036, 1040, 1044, 1051, 1055, 1059, 1066, 1070, 1074, 1082,
1091, 1097, 1100, 1106, 1112, 1119, 1128, 1137, 1145, 1148,
1155, 1159, 1166, 1169, 1173, 1177, 1186, 1195, 1203, 1213,
1225, 1228, 1231, 1237, 1244, 1247, 1253, 1256, 1259, 1265,
1268, 1283, 1287, 1291, 1295, 1299, 1303, 1308, 1313, 1318,
1323, 1328, 1333, 1338, 1343, 1348, 1353, 1358, 1363, 1368,
1373, 1378, 1383, 1388, 1393, 1398, 1403, 1408, 1412, 1416,
1420, 1424, 1428, 1432, 1436, 1440, 1444, 1448, 1452, 1456,
1460, 1464, 1468, 1476, 1484, 1488, 1501, 1501, 1504, 1504,
1510, 1513, 1529, 1532, 1541, 1545, 1551, 1558, 1573, 1577,
1581, 1582, 1588, 1589, 1590, 1591, 1592, 1596, 1597, 1597,
1597, 1607, 1608, 1612, 1612, 1613, 1613, 1618, 1621, 1631,
1634, 1640, 1641, 1645, 1653, 1657, 1667, 1672, 1689, 1689,
1694, 1694, 1701, 1701, 1709, 1712, 1718, 1721, 1727, 1731,
1738, 1745, 1752, 1759, 1770, 1779, 1783, 1790, 1793, 1799,
1799
};
#endif
......@@ -3313,9 +3313,10 @@ yyreduce:
case 75:
{
if ((yyvsp[(1) - (2)].interm).intermAggregate)
(yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
(yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
TIntermAggregate *aggNode = (yyvsp[(1) - (2)].interm).intermAggregate;
if (aggNode && aggNode->getOp() == EOpNull)
aggNode->setOp(EOpDeclaration);
(yyval.interm.intermNode) = aggNode;
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment