view dmd/InlineCostState.d @ 80:d0f297f8650b

added probably needed dmd patch to the 2.035 branch
author Trass3r
date Mon, 30 Aug 2010 12:16:44 +0200
parents 10317f0c89a5
children be2ab491772e
line wrap: on
line source

module dmd.InlineCostState;

import dmd.FuncDeclaration;
import dmd.Array;
import dmd.Expression;

struct InlineCostState
{
    int nested;
    int hasthis;
    int hdrscan;    // !=0 if inline scan for 'header' content
    FuncDeclaration fd;
}

const int COST_MAX = 250;

int arrayInlineCost(InlineCostState* ics, Array arguments)
{
	int cost = 0;

    if (arguments)
    {
		for (int i = 0; i < arguments.dim; i++)
		{   
			Expression e = cast(Expression)arguments.data[i];
			if (e)
				cost += e.inlineCost(ics);
		}
    }
    return cost;
}