summaryrefslogtreecommitdiff
path: root/Context.hh
diff options
context:
space:
mode:
Diffstat (limited to 'Context.hh')
-rw-r--r--Context.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/Context.hh b/Context.hh
index 2bbcaa4..9a30721 100644
--- a/Context.hh
+++ b/Context.hh
@@ -1,21 +1,30 @@
#ifndef PCC_CONTEXT_H
#define PCC_CONTEXT_H
+#include <stack>
+
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Module.h>
#include "TypeManager.hh"
+#include "VariableList.hh"
namespace pcc {
class Context {
public:
Context(const char* name);
TypeManager* GetTypeManager();
+ VariableList GetGlobals();
llvm::Module* GetModule();
llvm::IRBuilder<>* GetBuilder();
+ VariableList* GetCurrentScope();
+ void PushScope(VariableList* scope);
+ void PopScope();
private:
TypeManager TypeManager_;
+ VariableList globals_;
+ std::stack<VariableList*> scopes_;
llvm::IRBuilder<> builder_;
llvm::Module module_;
};