Ejemplo n.º 1
0
MergeResult ThreeWayMerge::mergeKeySet (const MergeTask & task)
{

	MergeResult result;
	detectConflicts (task, result);
	detectConflicts (task.reverse (), result, true);

	if (!result.hasConflicts ()) return result;


	// TODO: test this behaviour (would probably need mocks)
	Key current;
	KeySet conflicts = result.getConflictSet ();
	conflicts.rewind ();
	while ((current = conflicts.next ()))
	{
		for (auto & elem : strategies)
		{
			(elem)->resolveConflict (task, current, result);

			if (!result.isConflict (current)) break;
		}
	}

	return result;
}
Ejemplo n.º 2
0
MergeResult ThreeWayMerge::mergeKeySet(const MergeTask& task)
{

	MergeResult result;
	detectConflicts (task, result);
	detectConflicts (task.reverse (), result, true);

	if (!result.hasConflicts()) return result;


	// TODO: test this behaviour (would probably need mocks)
	Key current;
	KeySet conflicts = result.getConflictSet();
	conflicts.rewind();
	while ((current = conflicts.next ()))
	{
		for (vector<MergeConflictStrategy *>::iterator it = strategies.begin (); it != strategies.end (); ++it)
		{
			(*it)->resolveConflict (task, current, result);

			if (!result.isConflict(current))
				break;
		}
	}

	return result;
}
Ejemplo n.º 3
0
void infeas_analysis( char *obj_file ) {

  readInstr( obj_file );
  readBlockCounts( obj_file );

  clearReg();
  initRegSet();
  //printInstructions();

  printf( "Starting symbolic execution...\n" ); fflush(stdout);
  execute();
  //printEffects(0);

  printf( "Starting conflict detection...\n" ); fflush(stdout);
  detectConflicts();
  printf( "Detected %d BB and %d BA\n", num_BB, num_BA ); fflush(stdout);
  //printEffects(1);
}
Ejemplo n.º 4
0
/*
 * Initializes infeasible path detection.
 */
int initInfeas()
{
  DSTART( "initInfeas" );

  int i, j;
  procedure *p;

  DOUT( "\nInitializing register set...\n" ); fflush(stdout);
  initRegSet();

  DOUT( "Allocating data structures...\n" ); fflush( stdout );
  MALLOC( num_assign, int**, num_procs * sizeof(int*), "num_assign" );
  MALLOC( assignlist, assign****, num_procs * sizeof(assign***), "assignlist" );
  MALLOC( branchlist, branch***, num_procs * sizeof(branch**),  "branchlist" );

  for( i = 0; i < num_procs; i++ ) {
    p = procs[i];

    CALLOC( num_assign[i], int*, p->num_bb, sizeof(int), "num_assign elm" );
    MALLOC( assignlist[i], assign***, p->num_bb * sizeof(assign**), "assignlist elm" );
    MALLOC( branchlist[i], branch**, p->num_bb * sizeof(branch*),  "branchlist elm" );

    for( j = 0; j < p->num_bb; j++ ) {
      assignlist[i][j] = NULL;
      branchlist[i][j] = NULL;
    }
  }

  DOUT( "Detecting effects...\n" ); fflush( stdout );
  execute();

  DOUT( "\nFinding related effects...\n" ); fflush( stdout );
  detectConflicts();

  DOUT( "Detected %d BB and %d BA\n", num_BB, num_BA );
  DRETURN( 0 );
}