Commit 06145236 by Jamie Madill

Refactor style in ParseContext.h.

BUG=angleproject:995 Change-Id: I893785a068d0d5cf4afc18123896bf540e53a3e0 Reviewed-on: https://chromium-review.googlesource.com/270627Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 95d34aaf
...@@ -653,7 +653,7 @@ bool TParseContext::parameterSamplerErrorCheck(const TSourceLoc& line, TQualifie ...@@ -653,7 +653,7 @@ bool TParseContext::parameterSamplerErrorCheck(const TSourceLoc& line, TQualifie
return false; return false;
} }
bool TParseContext::containsSampler(TType& type) bool TParseContext::containsSampler(const TType& type)
{ {
if (IsSampler(type.getBasicType())) if (IsSampler(type.getBasicType()))
return true; return true;
...@@ -750,12 +750,13 @@ bool TParseContext::arrayQualifierErrorCheck(const TSourceLoc &line, const TPubl ...@@ -750,12 +750,13 @@ bool TParseContext::arrayQualifierErrorCheck(const TSourceLoc &line, const TPubl
// //
// Returns true if there is an error. // Returns true if there is an error.
// //
bool TParseContext::arrayTypeErrorCheck(const TSourceLoc& line, TPublicType type) bool TParseContext::arrayTypeErrorCheck(const TSourceLoc& line, const TPublicType &type)
{ {
// //
// Can the type be an array? // Can the type be an array?
// //
if (type.array) { if (type.array)
{
error(line, "cannot declare arrays of arrays", TType(type).getCompleteString().c_str()); error(line, "cannot declare arrays of arrays", TType(type).getCompleteString().c_str());
return true; return true;
} }
...@@ -889,7 +890,7 @@ bool TParseContext::extensionErrorCheck(const TSourceLoc& line, const TString& e ...@@ -889,7 +890,7 @@ bool TParseContext::extensionErrorCheck(const TSourceLoc& line, const TString& e
// These checks are common for all declarations starting a declarator list, and declarators that follow an empty // These checks are common for all declarations starting a declarator list, and declarators that follow an empty
// declaration. // declaration.
// //
bool TParseContext::singleDeclarationErrorCheck(TPublicType &publicType, const TSourceLoc &identifierLocation) bool TParseContext::singleDeclarationErrorCheck(const TPublicType &publicType, const TSourceLoc &identifierLocation)
{ {
switch (publicType.qualifier) switch (publicType.qualifier)
{ {
...@@ -1095,7 +1096,7 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& line, TFunction* ...@@ -1095,7 +1096,7 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& line, TFunction*
// //
// Returns true on error, false if no error // Returns true on error, false if no error
// //
bool TParseContext::executeInitializer(const TSourceLoc &line, const TString &identifier, TPublicType &pType, bool TParseContext::executeInitializer(const TSourceLoc &line, const TString &identifier, const TPublicType &pType,
TIntermTyped *initializer, TIntermNode **intermNode) TIntermTyped *initializer, TIntermNode **intermNode)
{ {
ASSERT(intermNode != nullptr); ASSERT(intermNode != nullptr);
...@@ -1357,7 +1358,7 @@ TIntermAggregate *TParseContext::parseSingleArrayDeclaration(TPublicType &public ...@@ -1357,7 +1358,7 @@ TIntermAggregate *TParseContext::parseSingleArrayDeclaration(TPublicType &public
return intermediate.makeAggregate(symbol, identifierLocation); return intermediate.makeAggregate(symbol, identifierLocation);
} }
TIntermAggregate *TParseContext::parseSingleInitDeclaration(TPublicType &publicType, TIntermAggregate *TParseContext::parseSingleInitDeclaration(const TPublicType &publicType,
const TSourceLoc &identifierLocation, const TSourceLoc &identifierLocation,
const TString &identifier, const TString &identifier,
const TSourceLoc &initLocation, const TSourceLoc &initLocation,
...@@ -1539,7 +1540,7 @@ TIntermAggregate *TParseContext::parseArrayDeclarator(TPublicType &publicType, T ...@@ -1539,7 +1540,7 @@ TIntermAggregate *TParseContext::parseArrayDeclarator(TPublicType &publicType, T
return nullptr; return nullptr;
} }
TIntermAggregate *TParseContext::parseInitDeclarator(TPublicType &publicType, TIntermAggregate *aggregateDeclaration, TIntermAggregate *TParseContext::parseInitDeclarator(const TPublicType &publicType, TIntermAggregate *aggregateDeclaration,
const TSourceLoc &identifierLocation, const TString &identifier, const TSourceLoc &identifierLocation, const TString &identifier,
const TSourceLoc &initLocation, TIntermTyped *initializer) const TSourceLoc &initLocation, TIntermTyped *initializer)
{ {
...@@ -1576,7 +1577,7 @@ TIntermAggregate *TParseContext::parseInitDeclarator(TPublicType &publicType, TI ...@@ -1576,7 +1577,7 @@ TIntermAggregate *TParseContext::parseInitDeclarator(TPublicType &publicType, TI
} }
} }
TIntermAggregate *TParseContext::parseArrayInitDeclarator(TPublicType &publicType, TIntermAggregate *TParseContext::parseArrayInitDeclarator(const TPublicType &publicType,
TIntermAggregate *aggregateDeclaration, TIntermAggregate *aggregateDeclaration,
const TSourceLoc& identifierLocation, const TSourceLoc& identifierLocation,
const TString &identifier, const TString &identifier,
...@@ -1668,8 +1669,9 @@ void TParseContext::parseGlobalLayoutQualifier(const TPublicType &typeQualifier) ...@@ -1668,8 +1669,9 @@ void TParseContext::parseGlobalLayoutQualifier(const TPublicType &typeQualifier)
} }
} }
TFunction *TParseContext::addConstructorFunc(TPublicType publicType) TFunction *TParseContext::addConstructorFunc(const TPublicType &publicTypeIn)
{ {
TPublicType publicType = publicTypeIn;
TOperator op = EOpNull; TOperator op = EOpNull;
if (publicType.userDef) if (publicType.userDef)
{ {
......
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