Cleanup TType and related classes:
1. Removed unused functions
2. Removed unnecessary virtuality of functions
3. Grouped related functions together
TEST=conformance tests
Review URL: http://codereview.appspot.com/1984047
git-svn-id: https://angleproject.googlecode.com/svn/trunk@400 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/ParseHelper.cpp b/src/compiler/ParseHelper.cpp
index c52bcbb..407226b 100644
--- a/src/compiler/ParseHelper.cpp
+++ b/src/compiler/ParseHelper.cpp
@@ -486,7 +486,7 @@
}
if (constType)
- type->changeQualifier(EvqConst);
+ type->setQualifier(EvqConst);
if (type->isArray() && type->getArraySize() != function.getParamCount()) {
error(line, "array constructor needs one argument per array element", "constructor", "");
@@ -586,14 +586,14 @@
{
if (pType.type == EbtStruct) {
if (containsSampler(*pType.userDef)) {
- error(line, reason, TType::getBasicString(pType.type), "(structure contains a sampler)");
+ error(line, reason, getBasicString(pType.type), "(structure contains a sampler)");
return true;
}
return false;
} else if (IsSampler(pType.type)) {
- error(line, reason, TType::getBasicString(pType.type), "");
+ error(line, reason, getBasicString(pType.type), "");
return true;
}
@@ -879,9 +879,9 @@
}
if (qualifier == EvqConst)
- type->changeQualifier(EvqConstReadOnly);
+ type->setQualifier(EvqConstReadOnly);
else
- type->changeQualifier(paramQualifier);
+ type->setQualifier(paramQualifier);
return false;
}
@@ -976,13 +976,13 @@
if (qualifier == EvqConst) {
if (qualifier != initializer->getType().getQualifier()) {
error(line, " assigning non-constant to", "=", "'%s'", variable->getType().getCompleteString().c_str());
- variable->getType().changeQualifier(EvqTemporary);
+ variable->getType().setQualifier(EvqTemporary);
return true;
}
if (type != initializer->getType()) {
error(line, " non-matching types for const initializer ",
variable->getType().getQualifierString(), "");
- variable->getType().changeQualifier(EvqTemporary);
+ variable->getType().setQualifier(EvqTemporary);
return true;
}
if (initializer->getAsConstantUnion()) {
@@ -1001,7 +1001,7 @@
variable->shareConstPointer(constArray);
} else {
error(line, " cannot assign to", "=", "'%s'", variable->getType().getCompleteString().c_str());
- variable->getType().changeQualifier(EvqTemporary);
+ variable->getType().setQualifier(EvqTemporary);
return true;
}
}
@@ -1052,7 +1052,7 @@
TIntermAggregate* aggrNode = node->getAsAggregate();
- TTypeList::iterator memberTypes;
+ TTypeList::const_iterator memberTypes;
if (op == EOpConstructStruct)
memberTypes = type->getStruct()->begin();
@@ -1350,7 +1350,7 @@
//
TIntermTyped* TParseContext::addConstStruct(TString& identifier, TIntermTyped* node, TSourceLoc line)
{
- TTypeList* fields = node->getType().getStruct();
+ const TTypeList* fields = node->getType().getStruct();
TIntermTyped *typedNode;
int instanceSize = 0;
unsigned int index = 0;