namespace GL {
namespace SL {
+/** Finds functions which are candidates for inlining. Currently this means
+functions which have no parameters, are only called once, and that call occurs
+after the definition of the function. */
class InlineableFunctionLocator: private TraversingVisitor
{
private:
virtual void visit(FunctionDeclaration &);
};
+/** Inlines functions. Internally uses InlineableFunctionLocator to find
+candidate functions. Only functions which consist of a single return statement
+are inlined. */
class FunctionInliner: private TraversingVisitor
{
private:
virtual void visit(Return &);
};
+/** Removes conditional statements and loops where the condition can be
+determined as constant at compile time. */
class ConstantConditionEliminator: private TraversingVisitor
{
private:
virtual void visit(Iteration &);
};
+/** Removes variable declarations with no references to them. Assignment
+statements where the result is not used are also removed. */
class UnusedVariableRemover: private TraversingVisitor
{
private:
private:
virtual void visit(VariableReference &);
+ virtual void visit(InterfaceBlockReference &);
virtual void visit(MemberAccess &);
virtual void visit(BinaryExpression &);
virtual void visit(Assignment &);
virtual void visit(Iteration &);
};
+/** Removes function declarations with no references to them. */
class UnusedFunctionRemover: private TraversingVisitor
{
private: