Clean up temporary variable usage in ScalarizeVecAndMatConstructorArgs
Use common helper functions instead of manually creating temporary
variable nodes. Also clean up the interface provided by the traverser.
BUG=angleproject:1597
Test=WebGL conformance tests
Change-Id: Ifd8d3815ff9e75e1a2040d65db9d4b3d6a9a9273
Reviewed-on: https://chromium-review.googlesource.com/403950
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/IntermTraverse.cpp b/src/compiler/translator/IntermTraverse.cpp
index 1e623d1..c6a199e 100644
--- a/src/compiler/translator/IntermTraverse.cpp
+++ b/src/compiler/translator/IntermTraverse.cpp
@@ -151,7 +151,11 @@
TIntermSymbol *node = new TIntermSymbol(0, symbolName, type);
node->setInternal(true);
+
+ ASSERT(qualifier == EvqTemporary || qualifier == EvqConst || qualifier == EvqGlobal);
node->getTypePointer()->setQualifier(qualifier);
+ // TODO(oetuaho): Might be useful to sanitize layout qualifier etc. on the type of the created
+ // symbol. This might need to be done in other places as well.
return node;
}