Mercurial > hg > CbC > CbC_llvm
diff examples/ParallelJIT/ParallelJIT.cpp @ 95:afa8332a0e37 LLVM3.8
LLVM 3.8
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Oct 2015 17:48:58 +0900 |
parents | 54457678186b |
children | 7d135dc70f03 |
line wrap: on
line diff
--- a/examples/ParallelJIT/ParallelJIT.cpp Wed Feb 18 14:56:07 2015 +0900 +++ b/examples/ParallelJIT/ParallelJIT.cpp Tue Oct 13 17:48:58 2015 +0900 @@ -17,6 +17,7 @@ // call into the JIT at the same time (or the best possible approximation of the // same time). This test had assertion errors until I got the locking right. +#include "llvm/ADT/STLExtras.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/ExecutionEngine/Interpreter.h" #include "llvm/IR/Constants.h" @@ -27,6 +28,7 @@ #include "llvm/Support/TargetSelect.h" #include <iostream> #include <pthread.h> + using namespace llvm; static Function* createAdd1(Module *M) { @@ -37,7 +39,7 @@ cast<Function>(M->getOrInsertFunction("add1", Type::getInt32Ty(M->getContext()), Type::getInt32Ty(M->getContext()), - (Type *)0)); + nullptr)); // Add a basic block to the function. As before, it automatically inserts // because of the last argument. @@ -68,7 +70,7 @@ cast<Function>(M->getOrInsertFunction("fib", Type::getInt32Ty(M->getContext()), Type::getInt32Ty(M->getContext()), - (Type *)0)); + nullptr)); // Add a basic block to the function. BasicBlock *BB = BasicBlock::Create(M->getContext(), "EntryBlock", FibF); @@ -128,10 +130,10 @@ n = 0; waitFor = 0; - int result = pthread_cond_init( &condition, NULL ); + int result = pthread_cond_init( &condition, nullptr ); assert( result == 0 ); - result = pthread_mutex_init( &mutex, NULL ); + result = pthread_mutex_init( &mutex, nullptr ); assert( result == 0 ); } @@ -260,21 +262,21 @@ struct threadParams fib2 = { EE, fibF, 42 }; pthread_t add1Thread; - int result = pthread_create( &add1Thread, NULL, callFunc, &add1 ); + int result = pthread_create( &add1Thread, nullptr, callFunc, &add1 ); if ( result != 0 ) { std::cerr << "Could not create thread" << std::endl; return 1; } pthread_t fibThread1; - result = pthread_create( &fibThread1, NULL, callFunc, &fib1 ); + result = pthread_create( &fibThread1, nullptr, callFunc, &fib1 ); if ( result != 0 ) { std::cerr << "Could not create thread" << std::endl; return 1; } pthread_t fibThread2; - result = pthread_create( &fibThread2, NULL, callFunc, &fib2 ); + result = pthread_create( &fibThread2, nullptr, callFunc, &fib2 ); if ( result != 0 ) { std::cerr << "Could not create thread" << std::endl; return 1;