summaryrefslogtreecommitdiff
path: root/program.cpp
blob: 1d7f31bed9182a2bae7642ea1f15e12f8abd97a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "program.h"

#include "value.h"

program::program() :
	num_private_regs(0)
	{ }

register_address
program::add_immediate(float value)
{
	m_immediate_regs.push_back(new float_value(value));
	return register_address(REGISTER_TYPE_IMMEDIATE, m_immediate_regs.size() - 1);
}

void
program::add_instruction(instruction * inst)
{
	m_instructions.push_back(inst);
}

register_address
program::alloc_private_reg()
{
	return register_address(REGISTER_TYPE_PRIVATE, num_private_regs++);
}