3 void printArgs(CallInst *);
5 bool isAtomicCall(Instruction *I)
7 if ( auto *CI = dyn_cast<CallInst>(I) ) {
8 Function *fun = CI->getCalledFunction();
12 StringRef funName = fun->getName();
14 // todo: come up with better rules for function name checking
15 if ( funName.contains("atomic_") ) {
18 } else if (funName.contains("atomic") ) {
19 // errs() << "intercepted atomic calls: " << *I << "\n";
27 void printArgs (CallInst *CI)
29 Function *fun = CI->getCalledFunction();
30 StringRef funName = fun->getName();
32 User::op_iterator begin = CI->arg_begin();
33 User::op_iterator end = CI->arg_end();
35 if ( funName.contains("atomic_") ) {
36 std::vector<Value *> parameters;
38 for (User::op_iterator it = begin; it != end; ++it) {
40 parameters.push_back(param);
41 errs() << *param << " type: " << *param->getType() << "\n";