summaryrefslogtreecommitdiff
path: root/Context.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Context.cc')
-rw-r--r--Context.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/Context.cc b/Context.cc
index 64c9d58..d009835 100644
--- a/Context.cc
+++ b/Context.cc
@@ -9,11 +9,21 @@ llvm::LLVMContext GlobalLLVMContext;
Context::Context(const char* name)
: builder_(GlobalLLVMContext)
- , module_(name, GlobalLLVMContext) {}
+ , module_(name, GlobalLLVMContext) {
+ scopes_.push(&globals_);
+}
TypeManager* Context::GetTypeManager() { return &TypeManager_; }
+VariableList Context::GetGlobals() { return &globals_; }
+
llvm::Module* Context::GetModule() { return &module_; }
llvm::IRBuilder<>* Context::GetBuilder() { return &builder_; }
+
+VariableList* Context::GetCurrentScope() { return scopes_.top(); }
+
+void Context::PushScope(VariableList* scope) { scopes_.push(scope); }
+
+void Context::PopScope() { scopes_.pop(); }
} // namespace pcc