sammine-lang
Loading...
Searching...
No Matches
CodegenUtils.h
1
2#include <llvm/IR/DerivedTypes.h>
3#include <llvm/IR/Function.h>
4#include <llvm/IR/Instructions.h>
5#include <llvm/IR/LLVMContext.h>
6
7#include "ast/AstDecl.h"
8#include "codegen/LLVMRes.h"
9namespace sammine_lang {
10using namespace AST;
12
13public:
14 static llvm::AllocaInst *CreateEntryBlockAlloca(llvm::Function *TheFunction,
15 const std::string &VarName,
16 llvm::Type *);
17
18 static bool isFunctionMain(FuncDefAST *);
19 static bool hasFunctionMain(ProgramAST *);
20
21 static llvm::FunctionCallee declare_malloc(llvm::Module &);
22 static llvm::FunctionCallee declare_free(llvm::Module &);
23
24 static llvm::FunctionCallee
25 declare_fn(llvm::Module &module, const std::string &name,
26 llvm::Type *return_type, llvm::ArrayRef<llvm::Type *> param_types,
27 bool is_vararg = false);
28};
29
30} // namespace sammine_lang
Holds declaration for all the AST Nodes.
Defined LLVMRes, which encapsulates the state of LLVM (Context, Modules, IRBuilder,...
Definition Ast.h:326
Definition Ast.h:197
Definition CodegenUtils.h:11