diff options
Diffstat (limited to 'Context.cc')
| -rw-r--r-- | Context.cc | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 |
