Treat returns with expressions as return param use

There are many cases of code where the return parameters exist mostly
as a form of documentation.  This change ensures that they do not have
to be used in the function body so long as there is a return supplying
values
This commit is contained in:
Rhett Aultman
2017-05-03 11:26:21 +02:00
committed by chriseth
parent a40c8cfb68
commit a6faa5acf3
3 changed files with 30 additions and 1 deletions
+2 -1
View File
@@ -63,7 +63,7 @@ private:
virtual bool visit(ExpressionStatement const& _statement) override;
virtual bool visit(VariableDeclaration const& _variable) override;
virtual bool visit(Identifier const& _identifier) override;
virtual bool visit(Return const& _return) override;
virtual bool visit(MemberAccess const& _memberAccess) override;
ErrorList& m_errors;
@@ -76,6 +76,7 @@ private:
std::map<VariableDeclaration const*, int> m_localVarUseCount;
const FunctionDefinition *m_currentFunction;
bool m_inFunction = false;
};