X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11llvm.git;a=blobdiff_plain;f=isAtomicCall.hpp;h=99e7532af64c49e670dc009512d2660beee4f02b;hp=11e5e68b77ee25a02d8a84ac4e39f7280d220b2f;hb=c9efd55388808675480a2f3f476959dd7e5de4be;hpb=6f6588a61182c45280645a332e04666ccefd9272;ds=sidebyside diff --git a/isAtomicCall.hpp b/isAtomicCall.hpp index 11e5e68..99e7532 100644 --- a/isAtomicCall.hpp +++ b/isAtomicCall.hpp @@ -6,12 +6,18 @@ bool isAtomicCall(Instruction *I) { if ( auto *CI = dyn_cast(I) ) { Function *fun = CI->getCalledFunction(); + if (fun == NULL) + return false; + StringRef funName = fun->getName(); - if ( (CI->isTailCall() && funName.contains("atomic_")) || - funName.contains("atomic_compare_exchange_") ) { + // todo: come up with better rules for function name checking + if ( funName.contains("atomic_") ) { // printArgs(CI); return true; + } else if (funName.contains("atomic") ) { + // errs() << "intercepted atomic calls: " << *I << "\n"; + return true; } }