-
Notifications
You must be signed in to change notification settings - Fork 3
/
Codegen.h
38 lines (32 loc) · 1.09 KB
/
Codegen.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <bits/stdc++.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <map>
using namespace std;
#include <llvm/IR/Module.h>
#include <llvm/IR/Function.h>
#include <llvm/IR/Type.h>
#include <llvm/IR/DerivedTypes.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/Target/TargetMachine.h>
#include <llvm/IR/PassManager.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/CallingConv.h>
#include <llvm/IR/Verifier.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/Support/TargetSelect.h>
#include <llvm/ExecutionEngine/GenericValue.h>
#include <llvm/Support/raw_ostream.h>
using namespace llvm;
Function *createFunc(IRBuilder<> &, std::string);
BasicBlock *createBB(Function *, std::string);
GlobalVariable *createGlob(IRBuilder<> &, std::string);
Value *createArith(IRBuilder<> &, Value *, Value *);
AllocaInst *CreateEntryBlockAlloca(Function *, string , string ) ;
void setFuncArgs(Function *, std::vector<std::string>);
extern Module *TheModule;
extern IRBuilder <> Builder;
extern std::vector<std::string> FunArgs;
extern LLVMContext Context;
extern Value* Codegen(struct ASTNode *root);