diff options
| author | Nagi5Yeq <wu@x-nagi.com> | 2020-05-25 00:53:57 +0800 |
|---|---|---|
| committer | Nagi5Yeq <wu@x-nagi.com> | 2020-05-25 00:53:57 +0800 |
| commit | c5e9f890dab0e4595482301d77876793c8bceb8c (patch) | |
| tree | cb115b6b5b8ffaa5d0de88f9ad5df34016223ec6 /Context.hh | |
| parent | 3832be8be4b23fb9e93a3f181e4205eadbdbf4de (diff) | |
finish function node.
Parser.y: rename 'context' to 'ctx' to avoid conflict in new version bison.
Diffstat (limited to 'Context.hh')
| -rw-r--r-- | Context.hh | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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_; }; |
