diff --git a/src/llvm/func.h b/src/llvm/func.h new file mode 100644 index 0000000..ac27a83 --- /dev/null +++ b/src/llvm/func.h @@ -0,0 +1,27 @@ + +#ifndef LLVM_BACKEND_FUNC_H_ +#define LLVM_BACKEND_FUNC_H_ + +#include + +#include + +typedef struct LLVMFuncScope_t { + LLVMGlobalScope* global_scope; + // of LLVMTypeRef + GHashTable* params; + LLVMValueRef llvm_func; +} LLVMFuncScope; + +typedef struct LLVMLocalScope_t LLVMLocalScope; + +typedef struct LLVMLocalScope_t { + // of LLVMTypeRef + GHashTable* vars; + LLVMFuncScope* func_scope; + LLVMLocalScope* parent_scope; +} LLVMLocalScope; + +LLVMValueRef get_variable(const LLVMLocalScope* scope, const char* name); + +#endif // LLVM_BACKEND_FUNC_H_