/*****************************************************************\
*                                                                *
*  Copyright (C) Regents of University of California, 2003       *
*  This source code is a part of EXPRESSION project and is       *
*  copyrighted by the Regents of the University of California,   *
*  Irvine.                                                       *
*  The authors hereby grant permission to use this description   *
*  and its documentation for educational and non-commercial      *
*  purpose under the BSD license                                 *
*  (http://www.cecs.uci.edu/~express/BSD_License.txt). 	         *
*  The source code comes with no warranty and no author or       *
*  distributor accepts any responsibility for the consequences   *
*  of its use. Permission is granted to distribute this file in  *
*  compiled or executable form under the same conditions that    *
*  apply for source code. Permission is granted	to anyone to     *
*  make or distribute copies of this source code, either as      *
*  received or modified, in any medium, provided that all        *
*  copyright notices, permission and non warranty notices are    *
*  preserved, and that the distributor grants the recipient      *
*  permission for further redistribution as permitted by this    *
*  document. No written agreement, license, or royalty fee is    *
*  required for authorized use of this software.                 *
*                                                                *
*******************************************************************/
//: GToTRegMapProperty.cpp
//
// File:  		GToTRegMapProperty.cpp
// Created:		Tue Feb 08, 2000
// Author:		Radu Cornea
// Email:		radu@ics.uci.edu, ilp@ics.uci.edu
//
// This property contains a map between generic arguments (virtual registers)
// and real registers, as required by the actual architecture.
// The generic and real register are specified using their index in the symbol
// table (note: this is different from the ID, after SSA).
//


#include "stdafx.h"

#ifdef WIN32
#pragma warning(disable:4786)
#endif

#include "GToTRegMapProperty.h"

//START: MFC DEBUG NEW: THIS MUST BE AFTER ALL THE #INCLUDES IN A FILE
#ifdef WIN32
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#endif
//END MFC DEBUG NEW: 

void GToTRegMapProperty::print(ostream& out)
{
	cout << "Generic Register Index -> Target Register Index" << endl;
	
	for (map<int, int>::iterator iter = _regMap.begin(); iter != _regMap.end(); iter++) {
		int genericRegIndex = (*iter).first;
		int targetRegIndex = (*iter).second;

		cout << genericRegIndex << " -> " << targetRegIndex << "  type: " << (_hardConstraintMap[genericRegIndex] ? "hard" : "soft") << endl;
	}
}