Exemplo n.º 1
0
static  void    FlowConditions( void )
/*************************************
    For each block in the program, first "GatherSources" to determine
    what the state of the condition codes are on entry to the routine,
    then "Traverse" the block, to see if there is an instruction that
    sets the condition codes for the conditional branches at the end of
    the block correctly, or if the condition codes from previous blocks
    are unaffected by the block and will suffice for the final branch.
*/
{
    block       *blk;
    name        *zero;
    bool        change;

    zero = AllocIntConst( 0 );
    change = true;
    for( ;; ) {
        for( blk = HeadBlock; blk != NULL; blk = blk->next_block ) {
            GatherSources( blk );
            change |= Traverse( blk, zero );
        }
        if( change == false ) break;
        change = false;
    }
}
Exemplo n.º 2
0
void GatherSources(const String& master_path, const String& path_, Vector<int>& parents)
{
	RHITCOUNT("GatherSources");
	String path = NormalizeSourcePath(path_);
	if(sSrcFile.Find(path) >= 0)
		return;
	int ii = sSrcFile.GetCount();
	for(int i = 0; i < parents.GetCount(); i++)
		sIncludes.Add(MAKEQWORD(parents[i], ii));
	sSrcFile.Add(path, master_path);
	parents.Add(ii);
	const PPFile& f = GetPPFile(path);
	for(int i = 0; i < f.includes.GetCount(); i++) {
		String p = GetIncludePath(f.includes[i], GetFileFolder(path));
		if(p.GetCount())
			GatherSources(master_path, p, parents);
	}
	parents.Drop();
}
Exemplo n.º 3
0
void GatherSources(const String& master_path, const String& path)
{
	LTIMING("GatherSources");
	Vector<int> parents;
	GatherSources(NormalizeSourcePath(master_path), path, parents);
}