translator: Store symbol type in TField.
This allows us to keep a separate symbol type for each field in a
struct. This can allow us to assign internal names to struct types.
It could also allow us to add internal fields to user defined stucts.
Bug: angleproject:2665
Change-Id: I6a129107d9db66c54b98b07684c3ead5801712ba
Reviewed-on: https://chromium-review.googlesource.com/1101565
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index e3df66a..f8df136 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -4714,7 +4714,8 @@
type->makeArrays(*declarator->arraySizes());
}
- TField *field = new TField(type, declarator->name(), declarator->line());
+ TField *field =
+ new TField(type, declarator->name(), declarator->line(), SymbolType::UserDefined);
checkIsBelowStructNestingLimit(typeSpecifier.getLine(), *field);
fieldList->push_back(field);
}