aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/include/bindings.hpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-03-12 11:08:03 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-03-12 11:08:03 +0000
commitfd25256a37696de23d8f6c99827a97b63733845d (patch)
treedbfc5f680dcdf78ac62f0d7f1d6bb09271e8a6b2 /c_compiler/include/bindings.hpp
parentde1f50c2bfa7dfc3b758a0cb89c856534c4ab3a1 (diff)
downloadCompiler-fd25256a37696de23d8f6c99827a97b63733845d.tar.gz
Compiler-fd25256a37696de23d8f6c99827a97b63733845d.zip
Have to improve reg allocation
Diffstat (limited to 'c_compiler/include/bindings.hpp')
-rw-r--r--c_compiler/include/bindings.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/c_compiler/include/bindings.hpp b/c_compiler/include/bindings.hpp
index 983a10d..5dd1e1f 100644
--- a/c_compiler/include/bindings.hpp
+++ b/c_compiler/include/bindings.hpp
@@ -25,16 +25,21 @@ class VariableStackBindings
private:
std::map<std::string, DeclarationData> bindings;
int32_t stack_counter;
+ int8_t current_register;
public:
VariableStackBindings();
void insertBinding(std::string id, TypePtr type, int32_t stack_position);
void increaseStackPosition();
+ void resetRegister();
+ void increaseRegister();
int32_t getCurrentStackPosition() const;
int32_t getStackPosition(const std::string& id) const;
+ int8_t getCurrentRegister() const;
+
bool bindingExists(const std::string& id) const;
};