view dmd/DebugCondition.d @ 72:2e2a5c3f943a

reduced warnings by adding override to the methods think this also normalizes different line endings used all over the place
author Trass3r
date Sat, 28 Aug 2010 16:19:48 +0200
parents 10317f0c89a5
children e28b18c23469
line wrap: on
line source

module dmd.DebugCondition;

import dmd.DVCondition;
import dmd.Module;
import dmd.Identifier;
import dmd.Scope;
import dmd.ScopeDsymbol;
import dmd.OutBuffer;
import dmd.HdrGenState;
import dmd.Array;
import dmd.String;
import dmd.Global;

import dmd.condition.util.findCondition;

class DebugCondition : DVCondition
{
    static void setGlobalLevel(uint level)
	{
		assert(false);
	}
	
    static void addGlobalIdent(const(char)* ident)
	{
		assert(false);
	}
	
    static void addPredefinedGlobalIdent(const(char)* ident)
	{
		assert(false);
	}

    this(Module mod, uint level, Identifier ident)
	{
		super(mod, level, ident);
	}

    override bool include(Scope sc, ScopeDsymbol s)
	{
		//printf("DebugCondition::include() level = %d, debuglevel = %d\n", level, global.params.debuglevel);
		if (inc == 0)
		{
			inc = 2;

			if (ident)
			{
				if (findCondition(mod.debugids, ident))
					inc = 1;
				else if (findCondition(global.params.debugids, ident))
					inc = 1;
				else
				{	
					if (!mod.debugidsNot)
						mod.debugidsNot = new Array();

					mod.debugidsNot.push(cast(void*)new String(ident.toChars()));
				}
			}
			else if (level <= global.params.debuglevel || level <= mod.debuglevel)
				inc = 1;
		}

		return (inc == 1);
	}
	
    override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
	{
		assert(false);
	}
}