Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Implementation of Programming Languages / Transpiler / src / LLVMVisitor / Register.cpp
blob: b2311d906c707389bcda91e3e24f48bb660c11bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "Register.h"

Register::Register() : counter(0) {}

Register& Register::operator++() {
	++counter;
	return *this;
}

Register Register::operator++(int) {
	Register old = *this;
	++(*this);
	return old;
}

std::string Register::operator*() {
	return "%" + std::to_string(counter);
}