3 void printArgs(CallInst *);
5 bool isAtomicCall(Instruction *I)
7 if ( auto *CI = dyn_cast<CallInst>(I) ) {
8 Function *fun = CI->getCalledFunction();
9 StringRef funName = fun->getName();
11 if ( (CI->isTailCall() && funName.contains("atomic_")) ||
12 funName.contains("atomic_compare_exchange_") ) {
21 void printArgs (CallInst *CI)
23 Function *fun = CI->getCalledFunction();
24 StringRef funName = fun->getName();
26 User::op_iterator begin = CI->arg_begin();
27 User::op_iterator end = CI->arg_end();
29 if (funName.find("atomic_") != -1) {
30 std::vector<Value *> parameters;
32 for (User::op_iterator it = begin; it != end; ++it) {
34 parameters.push_back(param);
35 errs() << *param << " type: " << *param->getType() << "\n";