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 if ( (CI->isTailCall() && funName.contains("atomic_")) ||
15 funName.contains("atomic_compare_exchange_") ) {
24 void printArgs (CallInst *CI)
26 Function *fun = CI->getCalledFunction();
27 StringRef funName = fun->getName();
29 User::op_iterator begin = CI->arg_begin();
30 User::op_iterator end = CI->arg_end();
32 if ( funName.contains("atomic_") ) {
33 std::vector<Value *> parameters;
35 for (User::op_iterator it = begin; it != end; ++it) {
37 parameters.push_back(param);
38 errs() << *param << " type: " << *param->getType() << "\n";