Commit 0a04b4df by John Kessenich

Front-end/Non-functional: Add some const/auto, useful for upcoming changes.

parent b9e39120
...@@ -4844,10 +4844,10 @@ const TFunction* TParseContext::findFunction120(const TSourceLoc& loc, const TFu ...@@ -4844,10 +4844,10 @@ const TFunction* TParseContext::findFunction120(const TSourceLoc& loc, const TFu
// more than one function." // more than one function."
const TFunction* candidate = nullptr; const TFunction* candidate = nullptr;
TVector<TFunction*> candidateList; TVector<const TFunction*> candidateList;
symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn);
for (TVector<TFunction*>::const_iterator it = candidateList.begin(); it != candidateList.end(); ++it) { for (auto it = candidateList.begin(); it != candidateList.end(); ++it) {
const TFunction& function = *(*it); const TFunction& function = *(*it);
// to even be a potential match, number of arguments has to match // to even be a potential match, number of arguments has to match
......
...@@ -357,7 +357,7 @@ public: ...@@ -357,7 +357,7 @@ public:
return (*it).second; return (*it).second;
} }
void findFunctionNameList(const TString& name, TVector<TFunction*>& list) void findFunctionNameList(const TString& name, TVector<const TFunction*>& list)
{ {
size_t parenAt = name.find_first_of('('); size_t parenAt = name.find_first_of('(');
TString base(name, 0, parenAt + 1); TString base(name, 0, parenAt + 1);
...@@ -624,7 +624,7 @@ public: ...@@ -624,7 +624,7 @@ public:
return false; return false;
} }
void findFunctionNameList(const TString& name, TVector<TFunction*>& list, bool& builtIn) void findFunctionNameList(const TString& name, TVector<const TFunction*>& list, bool& builtIn)
{ {
// For user levels, return the set found in the first scope with a match // For user levels, return the set found in the first scope with a match
builtIn = false; builtIn = false;
......
...@@ -3549,10 +3549,10 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, const TFu ...@@ -3549,10 +3549,10 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, const TFu
// exact match not found, look through a list of overloaded functions of the same name // exact match not found, look through a list of overloaded functions of the same name
const TFunction* candidate = nullptr; const TFunction* candidate = nullptr;
TVector<TFunction*> candidateList; TVector<const TFunction*> candidateList;
symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn);
for (TVector<TFunction*>::const_iterator it = candidateList.begin(); it != candidateList.end(); ++it) { for (auto it = candidateList.begin(); it != candidateList.end(); ++it) {
const TFunction& function = *(*it); const TFunction& function = *(*it);
// to even be a potential match, number of arguments has to match // to even be a potential match, number of arguments has to match
......
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