For some reasons, the compiler cannot find a matching Register::setName(const std::string&) although it is implemented in sal/Register.cc. The work around fixes this issue. git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@2077 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
39 lines
802 B
C++
39 lines
802 B
C++
#include "Architecture.hpp"
|
|
#include "../Register.hpp"
|
|
#include <sstream>
|
|
|
|
namespace fail {
|
|
|
|
ArmArchitecture::ArmArchitecture()
|
|
{
|
|
fillRegisterList();
|
|
}
|
|
|
|
void ArmArchitecture::fillRegisterList()
|
|
{
|
|
// TODO: Add missing registers
|
|
// 16x 32-Bit GP Registers
|
|
for (int i = 0; i < 16; i++) {
|
|
Register *reg = new Register(i, RT_GP, 32);
|
|
// Build and set the register name:
|
|
std::stringstream sstr;
|
|
sstr << "R" << i+1;
|
|
reg->setName(sstr.str().c_str());
|
|
m_addRegister(reg);
|
|
}
|
|
|
|
// Instruction Pointer
|
|
Register *reg = new Register(RI_IP, RT_IP, 32);
|
|
reg->setName("IP");
|
|
m_addRegister(reg);
|
|
}
|
|
|
|
ArmArchitecture::~ArmArchitecture()
|
|
{
|
|
for (std::vector<Register*>::iterator it = m_Registers.begin(); it != m_Registers.end(); it++)
|
|
delete *it;
|
|
m_Registers.clear();
|
|
}
|
|
|
|
} // end-of-namespace: fail
|