| 178 | | const llvm::Type* rEnginePointer = llvm::PointerType::get(llvm::Type::Int8Ty,0); |
|---|
| 179 | | llvm::FunctionType *runtimeStartupFuncType = llvm::FunctionType::get(rEnginePointer, std::vector<const llvm::Type*>(), false); |
|---|
| 180 | | llvm::Function *runtimeStartupFunc = llvm::Function::Create(runtimeStartupFuncType, llvm::Function::ExternalLinkage, "rphp_newRuntimeEngine", M); |
|---|
| 181 | | |
|---|
| 182 | | llvm::Instruction *runtimeStartInstr = llvm::CallInst::Create(runtimeStartupFunc, "runtime"); |
|---|
| 183 | | |
|---|
| 184 | | std::vector<const llvm::Type*> engineSig(1, rEnginePointer); |
|---|
| 185 | | llvm::FunctionType *runtimeDeleteFuncType = llvm::FunctionType::get(llvm::Type::VoidTy, engineSig, /*not vararg*/false); |
|---|
| 186 | | llvm::Function *runtimeDeleteFunc = llvm::Function::Create(runtimeDeleteFuncType, llvm::Function::ExternalLinkage, "rphp_deleteRuntimeEngine", M); |
|---|
| 187 | | |
|---|
| 188 | | std::vector<llvm::Value*> ArgsV; |
|---|
| 189 | | ArgsV.push_back(runtimeStartInstr); |
|---|
| 190 | | |
|---|
| 191 | | llvm::Instruction *runtimeDeleteInstr = llvm::CallInst::Create(runtimeDeleteFunc, ArgsV.begin(), ArgsV.end()); |
|---|
| | 184 | // const llvm::Type* rEnginePointer = llvm::PointerType::get(llvm::Type::Int8Ty,0); |
|---|
| | 185 | // llvm::FunctionType *runtimeStartupFuncType = llvm::FunctionType::get(rEnginePointer, std::vector<const llvm::Type*>(), false); |
|---|
| | 186 | // llvm::Function *runtimeStartupFunc = llvm::Function::Create(runtimeStartupFuncType, llvm::Function::ExternalLinkage, "rphp_newRuntimeEngine", M); |
|---|
| | 187 | // |
|---|
| | 188 | // llvm::Instruction *runtimeStartInstr = llvm::CallInst::Create(runtimeStartupFunc, "runtime"); |
|---|
| | 189 | // |
|---|
| | 190 | // std::vector<const llvm::Type*> engineSig(1, rEnginePointer); |
|---|
| | 191 | // llvm::FunctionType *runtimeDeleteFuncType = llvm::FunctionType::get(llvm::Type::VoidTy, engineSig, false); |
|---|
| | 192 | // llvm::Function *runtimeDeleteFunc = llvm::Function::Create(runtimeDeleteFuncType, llvm::Function::ExternalLinkage, "rphp_deleteRuntimeEngine", M); |
|---|
| | 193 | // |
|---|
| | 194 | // std::vector<llvm::Value*> ArgsV; |
|---|
| | 195 | // ArgsV.push_back(runtimeStartInstr); |
|---|
| | 196 | // |
|---|
| | 197 | // llvm::Instruction *runtimeDeleteInstr = llvm::CallInst::Create(runtimeDeleteFunc, ArgsV.begin(), ArgsV.end()); |
|---|
| | 198 | |
|---|
| | 199 | llvm::FunctionType *helloFuncType = llvm::FunctionType::get(llvm::Type::VoidTy, std::vector<const llvm::Type*>(), false); |
|---|
| | 200 | llvm::Function *helloFunc = llvm::Function::Create(helloFuncType, llvm::Function::ExternalLinkage, "sayHello", M); |
|---|
| | 201 | |
|---|
| | 202 | llvm::Instruction *helloInstr = llvm::CallInst::Create(helloFunc); |
|---|