Changeset 629
- Timestamp:
- 08/14/08 13:32:32 (3 months ago)
- Files:
-
- trunk/rphp/compiler/CMakeLists.txt (modified) (1 diff)
- trunk/rphp/compiler/pDriver.cpp (modified) (2 diffs)
- trunk/rphp/frontend/cli/CMakeLists.txt (modified) (2 diffs)
- trunk/rphp/runtime/include/pRuntime.h (modified) (1 diff)
- trunk/rphp/runtime/include/pVar.h (modified) (1 diff)
- trunk/rphp/runtime/pRuntime.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/rphp/compiler/CMakeLists.txt
r628 r629 3 3 4 4 # TODO: move this to a FindLLVM in cmake/modules 5 EXECUTE_PROCESS(COMMAND llvm-config --libs core jit bitreader bitwriter linker interpreter x86OUTPUT_VARIABLE LLVM_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)5 EXECUTE_PROCESS(COMMAND llvm-config --libs core jit bitreader bitwriter linker interpreter OUTPUT_VARIABLE LLVM_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE) 6 6 EXECUTE_PROCESS(COMMAND llvm-config --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE) 7 7 EXECUTE_PROCESS(COMMAND llvm-config --cppflags OUTPUT_VARIABLE LLVM_CPP_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) trunk/rphp/compiler/pDriver.cpp
r628 r629 197 197 198 198 // RUNTIME startup/shutdown test 199 // const llvm::Type* rEnginePointer = llvm::PointerType::get(llvm::Type::Int8Ty,0); 200 // llvm::FunctionType *runtimeStartupFuncType = llvm::FunctionType::get(rEnginePointer, std::vector<const llvm::Type*>(), false); 201 // llvm::Function *runtimeStartupFunc = llvm::Function::Create(runtimeStartupFuncType, llvm::Function::ExternalLinkage, "rphp_newRuntimeEngine", M); 202 // 203 // llvm::Instruction *runtimeStartInstr = llvm::CallInst::Create(runtimeStartupFunc, "runtime"); 204 // 205 // std::vector<const llvm::Type*> engineSig(1, rEnginePointer); 206 // llvm::FunctionType *runtimeDeleteFuncType = llvm::FunctionType::get(llvm::Type::VoidTy, engineSig, false); 207 // llvm::Function *runtimeDeleteFunc = llvm::Function::Create(runtimeDeleteFuncType, llvm::Function::ExternalLinkage, "rphp_deleteRuntimeEngine", M); 208 // 209 // std::vector<llvm::Value*> ArgsV; 210 // ArgsV.push_back(runtimeStartInstr); 211 // 212 // llvm::Instruction *runtimeDeleteInstr = llvm::CallInst::Create(runtimeDeleteFunc, ArgsV.begin(), ArgsV.end()); 213 214 llvm::FunctionType *helloFuncType = llvm::FunctionType::get(llvm::Type::VoidTy, std::vector<const llvm::Type*>(), false); 215 llvm::Function *helloFunc = llvm::Function::Create(helloFuncType, llvm::Function::ExternalLinkage, "sayHello", M); 216 217 llvm::Instruction *helloInstr = llvm::CallInst::Create(helloFunc); 199 const llvm::Type* rEnginePointer = llvm::PointerType::get(llvm::Type::Int8Ty,0); 200 llvm::FunctionType *runtimeStartupFuncType = llvm::FunctionType::get(rEnginePointer, std::vector<const llvm::Type*>(), false); 201 llvm::Function *runtimeStartupFunc = llvm::Function::Create(runtimeStartupFuncType, llvm::Function::ExternalLinkage, "rphp_newRuntimeEngine", M); 202 203 llvm::Instruction *runtimeStartInstr = llvm::CallInst::Create(runtimeStartupFunc, "runtime"); 204 205 std::vector<const llvm::Type*> engineSig(1, rEnginePointer); 206 llvm::FunctionType *runtimeDeleteFuncType = llvm::FunctionType::get(llvm::Type::VoidTy, engineSig, false); 207 llvm::Function *runtimeDeleteFunc = llvm::Function::Create(runtimeDeleteFuncType, llvm::Function::ExternalLinkage, "rphp_deleteRuntimeEngine", M); 208 209 std::vector<llvm::Value*> ArgsV; 210 ArgsV.push_back(runtimeStartInstr); 211 212 llvm::Instruction *runtimeDeleteInstr = llvm::CallInst::Create(runtimeDeleteFunc, ArgsV.begin(), ArgsV.end()); 218 213 219 214 // Get pointers to the constant integers... … … 228 223 BB->getInstList().push_back(Add); 229 224 230 //BB->getInstList().push_back(runtimeStartInstr); 231 //BB->getInstList().push_back(runtimeDeleteInstr); 232 BB->getInstList().push_back(helloInstr); 225 BB->getInstList().push_back(runtimeStartInstr); 226 BB->getInstList().push_back(runtimeDeleteInstr); 233 227 234 228 // Create the return instruction and add it to the basic block trunk/rphp/frontend/cli/CMakeLists.txt
r613 r629 1 1 # CLI frontend 2 2 MESSAGE( STATUS "CLI frontend check" ) 3 4 EXECUTE_PROCESS(COMMAND llvm-config --libs x86 OUTPUT_VARIABLE LLVM_X86_JIT OUTPUT_STRIP_TRAILING_WHITESPACE) 5 EXECUTE_PROCESS(COMMAND llvm-config --ldflags OUTPUT_VARIABLE LLVM_LD_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) 6 SEPARATE_ARGUMENTS(LLVM_X86_JIT) 3 7 4 8 include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${RPHP_RUNTIME_INCLUDE_DIR} ${RPHP_COMPILER_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) … … 9 13 10 14 add_executable( rphp ${CLI_SRC_FILES} ) 11 target_link_libraries( rphp rphp-eval rphp-runtime ${Boost_PROGRAM_OPTIONS_LIBRARY} ) 15 set_target_properties( rphp 16 PROPERTIES LINK_FLAGS ${LLVM_LD_FLAGS} 17 ) 18 target_link_libraries( rphp rphp-eval rphp-runtime ${Boost_PROGRAM_OPTIONS_LIBRARY} ${LLVM_X86_JIT} ) 12 19 trunk/rphp/runtime/include/pRuntime.h
r626 r629 76 76 extern "C" { 77 77 78 void sayHello(void);79 80 78 // create a new runtime engine 81 79 rphp::pRuntimeEngine* rphp_newRuntimeEngine(); trunk/rphp/runtime/include/pVar.h
r619 r629 31 31 32 32 /* 33 * Definition of the various types used in the rphp runtime, including the 34 * main pVar variant 33 * Definition of the main pVar variant 35 34 */ 36 35 trunk/rphp/runtime/pRuntime.cpp
r626 r629 63 63 } 64 64 65 void sayHello() {66 std::cout << "saying hello" << std::endl;67 }68 69 65 } 70 66
